mysql 重置密码:

/etc/init.d/mysql stop


mysqld_safe --skip-grant-tables &

mysqld_safe --skip-grant-tables --skip-networking &


#此时无需授权就可以进入到MySQL命令行,使用SQL重置MySQL密码:

use mysql;

UPDATE mysql.user SET Password=PASSWORD('admin') WHERE User='root' AND Host= '%';



FLUSH PRIVILEGES;



#新增用户

grant select,insert,update,delete on *.* to admin@"%" Identified by "admin";