mac 安装 mysql
1、社区版本下载
https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-5.7.28-macos10.14-x86_64.dmg
2、直接点击安装
3、环境变量配置
vim ./.bash_profile
export PATH=$PATH:/usr/local/mysql/bin
export PATH=$PATH:/usr/local/mysql/support-files
更新环境变量
vim ./.bash_profile
4、设置初始化密码
打开终端输入:
cd /usr/local/mysql/bin/
sudo ./mysqld_safe --skip-grant-tables
打开另外一个终端输入:
cd /usr/local/mysql/bin/
./mysql
FLUSH PRIVILEGES;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123');
网友评论