Resetting MySQL Root Password: Red Hat, CentOS

Resetting MySQL Root Password: Red Hat, CentOS

If you forgot the password of MySQL or you want to Resetting MySQL Root Password: Red Hat, CentOS then this article will help you to reset the password. MySQL password setting is most important essential tasks.  Root user is by default MySQL admin account user. Linux root account and MySQL root account are different. They are separate and nothing to do with each other. Let’s start Resetting MySQL Root Password: Red Hat, CentOS

Stop MySQL Service:

                root#  service mysqld stop

Just Start MySQL in safe mode:

                root#  mysqld_safe –skip-grant-tables &

Log into MySQL as root:

                root#  mysql -u root

Then Reset the password using following query:

                mysql>  update mysql.user set password=PASSWORD(“YourNewPassW0RD”) where User=’root’;

                mysql>  flush privileges; exit;

Log out of MySQL and stop the Safe Mode:

                root#  service mysqld stop

Then Start MySQL in the normal mode:

                root#  service mysqld start

Log into MySQL with your new password:

                root#  mysql -u root -p

                Enter password:

                mysql>

Bookmark the permalink.

Comments are closed.