How To Reset The MySQL 5.5 Server root Password
erics, Posted March 16th, 2022 at 2:39:07pm
Had an old server, needed to get root.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
service mysql stop ~OR~ service mysqld stop cd /etc/init.d; ./mysql<tab> start --skip-grant-tables mysql> update mysql.user set Password=PASSWORD('secret') where user='root'; mysql> flush privileges; mysql> ^D service mysql stop service mysql start ~OR~ service mysqld stop service mysqld start |
For MySQL 5.7:
https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html
For some other v5.7 nodes, I had admin access via a different user’s login, so all I needed was this:
1 2 |
ALTER USER 'root'@'localhost' IDENTIFIED BY 'secret'; ALTER USER 'root'@'%' IDENTIFIED BY 'secret'; |
Leave Your Comment
All fields marked with "*" are required.