MySQL 修改root密码

1. SQL> set password for root@localhost=password("xxx");

2. $ mysqladmin -u用户名 -p旧密码 password 新密码

忘记密码

1.SHELL> mysqld_safe --skip-grant-tables 启动后

2. SQL> use mysql;  update user set password=password("xxx") where user='root' and host='localhost';

原文地址:https://www.cnblogs.com/zhengwenqiang/p/7776900.html