http://blog.csdn.net/zmzwll1314/article/details/52926885
Installing MariaDB/mysql system tables in ‘/usr/local/var/mysql‘ ...
OK
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.2.12/bin/mysqladmin‘ -u root password ‘new-password‘
‘/usr/local/Cellar/mariadb/10.2.12/bin/mysqladmin‘ -u root -h lixiaolongdeiMac.local password ‘new-password‘
Alternatively you can run:
‘/usr/local/Cellar/mariadb/10.2.12/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.
You can start the MariaDB daemon with:
cd ‘/usr/local/Cellar/mariadb/10.2.12‘ ; /usr/local/Cellar/mariadb/10.2.12/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.2.12/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
Consider joining MariaDB‘s strong and vibrant community:
https://mariadb.org/get-involved/
lixiaolongdeiMac:etc lixiaolong$ brew install mariadb
==> Downloading https://homebrew.bintray.com/bottles/mariadb-10.2.12.sierra.bott
Already downloaded: /Users/lixiaolong/Library/Caches/Homebrew/mariadb-10.2.12.sierra.bottle.tar.gz
==> Pouring mariadb-10.2.12.sierra.bottle.tar.gz
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mariadb`
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
MySQL is configured to only allow connections from localhost by default
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.2.12: 640 files, 170MB