1.brew install mysql@5.7
2.
echo 'export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc
export LDFLAGS="-L/usr/local/opt/mysql@5.7/lib"
export CPPFLAGS="-I/usr/local/opt/mysql@5.7/include"
3.brew services start mysql@5.7
4.mysql_secure_installation
输入以上命令后,出现如下:
Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?
// 提示是否设置密码
Press y|Y for Yes, any other key for No: y
// 提示选择密码强度等级
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed

本文档详细介绍了如何在Mac系统中使用brew安装MySQL 5.7,包括修改环境变量、启动服务以及执行mysql_secure_installation进行安全性配置,如设置root密码、删除匿名用户和test数据库。
最低0.47元/天 解锁文章
931

被折叠的 条评论
为什么被折叠?



