1、sudo find / -name "mysqld_safe"
2、sudo /usr/bin/mysqld_safe --skip-grant-tables &
3、mysql -u root -p
4、UPDATE mysql.user SET Password = PASSWORD('123') WHERE User = 'root';
FLUSH PRIVILEGES;
5、重启mysqld服务
1、sudo find / -name "mysqld_safe"
2、sudo /usr/bin/mysqld_safe --skip-grant-tables &
3、mysql -u root -p
4、UPDATE mysql.user SET Password = PASSWORD('123') WHERE User = 'root';
FLUSH PRIVILEGES;
5、重启mysqld服务
本文标题:linux中忘记mysql的root用户密码
本文链接:https://www.haomeiwen.com/subject/mcufvxtx.html
网友评论