整體步驟:mysql
1. xcode-select --install 下載最新xcodesql 2. 配置並檢測Homebrew;數據庫 3. 下載MariaDB: brew install mariadbxcode 4. 啓動數據庫下載器 mysql_install_db(前提: 切換至安裝目錄下)ide 5. 啓動數據庫服務: mysql.server start工具 6. mysql_secure_installation: 對基本的一些信息的配置this 7. 鏈接數據庫: mysql -u root -pspa |
Mac 如今尚未 MariaDB 的官方安裝工具。不過你能夠用 Homebrew來 下載和安裝所需的包(其中包括所需的庫)。rest
第二部分 MariaDB 安裝重要的幾個步驟code
#下載 $ 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 the MariaDB daemon 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$ |