How to reset root password
How to reset root password
MySQL 5.7.6 and later
Modify /etc/my.cnf, append skip-grant-tables.
sed -i '/[mysqld]/a skip-grant-tables' /etc/my.cnf |
Restart mysql server, update root password.
select user,host,authentication_string from mysql.user; |
MySQL 5.7.5 and earlier
Modify /etc/my.cnf, append skip-grant-tables.
sed -i '/[mysqld]/a skip-grant-tables' /etc/my.cnf |
Restart mysql server, update root password.
select user,host,password from mysql.user; |
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.