mac for mysql5.7安装

 

brew安装mysql5.7

brew install [email protected]

设置环境变量

echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc

加载环境变量配置

exec zsh

配置MySQL

cd  ~

sudo vim .bash_profile

创建 export PATH=${PATH}:/usr/local/Cellar/[email protected]/5.7.25/bin,

:wq保存退出。

vi ~/.zshrc

追加 export PATH=${PATH}:/usr/local/Cellar/[email protected]/5.7.25/bin

source ~/.zshrc

启动mysql

brew services start [email protected]

进入mysql

mysql -u root 

修改密码策略

 set global validate_password_policy=LOW;

修改密码长度

 set global validate_password_length=4; 

修改密码

ALTER USER 'root'@'localhost' IDENTIFIED BY '1234'; 

https://blog.csdn.net/l0ve1o24/article/details/82764825

https://blog.csdn.net/u013737336/article/details/81532623

https://blog.csdn.net/hello_world_qwp/article/details/79551789

你可能感兴趣的:(mysql)