整体步骤: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$ |