我丢失了 MySQL 用户名和密码。如何找回?
最佳答案
Stop the MySQL process.
Start the MySQL process with the --skip-grant-tables option.
Start the MySQL console client with the -u root option.
列出所有用户;
SELECT * FROM mysql.user;
重置密码;
UPDATE mysql.user SET Password=PASSWORD('[password]') WHERE User='[username]';
但是不要忘记到
Stop the MySQL process
Start the MySQL Process normally (i.e. without the --skip-grant-tables option)
当你完成时。否则,您的数据库的安全性可能会受到威胁。
关于mysql - 如何找回我的 MySQL 用户名和密码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4371/