首页 > 代码库 > Mac 安装mysql

Mac 安装mysql

  下载mysql-5.7.14-osx10.11-x86_64.tar

# 移动解压后的二进制包到安装目录sudo mv mysql-5.6.24-osx10.9-x86_64 /usr/local/mysql# 更改 mysql 安装目录所属用户与用户组cd /usr/localsudo chown -R root:wheel mysql
cd /usr/local/mysqlsudo bin/mysqld --initialize --user=mysql
cd /usr/local/mysql# 启动sudo support-files/mysql.server start# 重启sudo support-files/mysql.server restart# 停止sudo support-files/mysql.server stop# 检查 MySQL 运行状态sudo support-files/mysql.server status
# 需要 MySQL 在运行状态执行cd /usr/local/mysql/bin./mysqladmin -u root password <your-password>
cd /usr/local/mysql/bin./mysql -u root -p<your-password>

 

Mac 安装mysql