数据库之:MySql数据库mac安装1
2019-11-17 本文已影响0人
前进的码农
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');