How to reset mysql root password in RedHat
My friend posted about reseting mysql root password long time ago. It still works but you have to know how to change root password properly. Since I have to do it by myself, I will explain more detail in this post.
- Add
skip-grant-tables
in section[mysqld]
in/etc/my.cnf
- Restart mysqld by
service mysqld restart
-
Change password using below query.
update mysql.user set password=password('new password') where user='root';
-
Remove
skip-grant-tables
from/etc/my.cnf
- Restart mysqld again
Tags: mysql, root password
- sugree's blog
- 2971 reads
Post new comment