启动
sudo /usr/local/mysql/support-files/mysql.server start
停止
sudo /usr/local/mysql/support-files/mysql.server stop
重启
sudo /usr/local/mysql/support-files/mysql.server restart
忘记密码
- 关闭mysql
sudo pkill -9 mysql - 本地启动
sudo /usr/local/mysql/support-files/mysql.server start --skip-grant-tables - 修改mysql.user表里面的password字段
update mysql.user set password='' where host='localhost';
flush privileges;
- 退出重启,即可在本地免密登录,之后按自己需求设置相应的用户密码
评论区