通过 Homebrew 安装 MySQL 和配置
文章目录
安装
- 安装 MySQL:
brew install mysql - 启动 MySQL:
mysql.server start - 检查 MySQL 服务状态:
systemctl status mysql.service 安全设置:
myqsl_secure_installation, 执行后提示安全策略: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 case, special characters and dictionary file根据提示选择密码等级, 设置 Root 密码
创建用户
- 创建用户:
create user 'herbert_u'@'%' identified by 'herbert_123'; 授权用户:
grant all privileges on retail_db.* to 'herbert_u'@'%'; flush privileges;
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论