brew安装mysql5.7
brew install mysql@5.7
设置环境变量
echo 'export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc
加载环境变量配置
exec zsh
配置MySQL
cd ~
sudo vim .bash_profile
创建 export PATH=${PATH}:/usr/local/Cellar/mysql@5.7/5.7.25/bin,
:wq保存退出。
vi ~/.zshrc
追加 export PATH=${PATH}:/usr/local/Cellar/mysql@5.7/5.7.25/bin
source ~/.zshrc
启动mysql
brew services start mysql@5.7
进入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