mysql 使用 homebrew 安装
启动方式:
To have launchd start mysql now and restart at login:
1,brew services start mysql
Or, if you don't want/need a background service you can just run:
2,mysql.server start
关闭mysql服务
第一种方式启动:
关闭系统自动重启mysql
1, brew services list
2, brew services stop mysql
第二种启动方式:
sudo /usr/local/mysql/support-files/mysql.server stop 或者系统偏好里有个 MySQL 里关闭
重置密码
cd /usr/local/mysql/bin (mysql 安装目录)
sudo./mysqld_safe --skip-grant-tables &(安全启动)
设置密码:
1,mysql -uroot -p(提示输入密码时随便输入即可)
2,flush privileges;(获取权限)
3,alter user 'root'@'localhost' identified by '123456';(设置密码mysql 8.xxx)