UBUNTU MysqL 5.7+ 重置root密码
mkdir /var/run/MysqLd; sudo chown MysqL /var/run/MysqLd MysqLd_safe --skip-grant-tables & MysqL -u root
重置密码。
UPDATE MysqL.user SET authentication_string = PASSWORD('MyNewPass'),password_expired = 'N' WHERE User = 'root' AND Host = 'localhost'; FLUSH PRIVILEGES;
参考:
https://dev.MysqL.com/doc/refman/5.7/en/resetting-permissions.html
http://askubuntu.com/questions/878652/unable-to-reset-MysqL-root-password-tried-everthing
https://support.rackspace.com/how-to/MysqL-resetting-a-lost-MysqL-root-password/