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";