brew services run mysql # 启动mysql 服务 brew services start mysql # 启动 mysql 服务,并注册开机自启 brew services stop mysql # 停止 mysql 服务,并取消开机自启 brew services restart mysql # 重启 mysql 服务,并注册开机自启 brew services cleanup # 清除已卸载应用的无用配置
mysql
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
brew install mysql
brew services start mysql brew services stop mysql
mysql -uroot SHOW VARIABLES LIKE 'validate_password%'; //查看密码初始策略
SET GLOBAL validate_password.policy=LOW; //设置某个属性 SET GLOBAL validate_password.length=6;
//修改密码 ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';
$ brew services stop mysql $ pkill mysqld $ rm -rf /usr/local/var/mysql/ # NOTE: this will delete your existing database!!! $ brew postinstall mysql $ brew services restart mysql $ mysql -u root