少于 1 分钟阅读

refer to:  https://skyf.org/reset-mysql579-root-password/

以及我的答案: http://stackoverflow.com/a/38070525/445908

Under MYSQL 5.7, If you are using mysql for development purpose, just :

1.kill mysql :

$ sudo service mysql stop

2.start mysql under --skip-grant-tables mode:

$ sudo mysqld_safe --skip-grant-tables

and, further, you could try to change the user table under "skip-grant-table" mode, however I failed.

so, this is just a workaround.

更新时间: