第一部分MariaDB安装(Mac)
总体步骤:
1. xcode-select --install 下载最新xcode
2. 配置并检测Homebrew;
3. 下载MariaDB: brew installmariadb
4. 启动数据库下载器 mysql_install_db(前提: 切换至安装目录下)
5. 启动数据库服务: mysql.server start
6. mysql_secure_installation: 对基本的一些信息的配置
7. 连接数据库: mysql -u root -p
Mac现在还没有MariaDB的官方安装工具。不过你可以用Homebrew来下载和安装所需的包(其中包括所需的库)。
第二部分MariaDB安装重要的几个步骤
#下载
$ brew install mariadb
. #链接数据库
To connect:
mysql -uroot
#如果想登陆启动数据库执行该语句
To have launchd start mariadb now and restart at login:
brew services start mariadb
#如果不想自启动执行该语句
Or, if you don't want/need a background service you can just run:
mysql.server start
==> Summary
� /usr/local/Cellar/mariadb/10.1.19: 574 files, 136.6M
*运行mysql_install_db安装程序
#与上一步的版本号匹配
$ cd /usr/local/Cellar/mariadb/10.1.19
$ mysql_install_db
.
.
.
.
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:
'/usr/local/Cellar/mariadb/10.1.19/bin/mysqladmin' -u root password 'new-password'
'/usr/local/Cellar/mariadb/10.1.19/bin/mysqladmin' -u root -h BWF-huanghaowei.local password 'new-password'
# 设置密码相关的内容, 可以使用如下命令
Alternatively you can run:
'/usr/local/Cellar/mariadb/10.1.19/bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.
##启动demo数据表
You can start theMariaDBdaemon with:
cd '/usr/local/Cellar/mariadb/10.1.19' ; /usr/local/Cellar/mariadb/10.1.19/bin/mysqld_safe --datadir='/usr/local/var/mysql'
You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/local/Cellar/mariadb/10.1.19/mysql-test' ; perl mysql-test-run.pl
Please report any problems at http://mariadb.org/jira
The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from MariaDB
Corporation Ab. You can contact us about this at sales@mariadb.com.
Alternatively consider joining our community based development effort:
http://mariadb.com/kb/en/contributing-to-the-mariadb-project/
BWF-huanghaowei:10.1.19 51Code$
网友评论