第一部分MariaDB安裝(Mac)
總體步驟:
1. xcode-select --install 下載最新xcode
2. 配置并檢測(cè)Homebrew;
3. 下載MariaDB: brew installmariadb
4. 啟動(dòng)數(shù)據(jù)庫(kù)下載器 mysql_install_db(前提: 切換至安裝目錄下)
5. 啟動(dòng)數(shù)據(jù)庫(kù)服務(wù): mysql.server start
6. mysql_secure_installation: 對(duì)基本的一些信息的配置
7. 連接數(shù)據(jù)庫(kù): mysql -u root -p
Mac現(xiàn)在還沒(méi)有MariaDB的官方安裝工具。不過(guò)你可以用Homebrew來(lái)下載和安裝所需的包(其中包括所需的庫(kù))。
第二部分MariaDB安裝重要的幾個(gè)步驟
#下載
$ brew install mariadb
. #鏈接數(shù)據(jù)庫(kù)
To connect:
mysql -uroot
#如果想登陸啟動(dòng)數(shù)據(jù)庫(kù)執(zhí)行該語(yǔ)句
To have launchd start mariadb now and restart at login:
brew services start mariadb
#如果不想自啟動(dòng)執(zhí)行該語(yǔ)句
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
*運(yùn)行mysql_install_db安裝程序
#與上一步的版本號(hào)匹配
$ 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'
# 設(shè)置密碼相關(guān)的內(nèi)容, 可以使用如下命令
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.
##啟動(dòng)demo數(shù)據(jù)表
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$