This Sheet describes the procedure how to change the root password of MySQL server.
- Stop MySQL server if its running.
# service mysqld stop
- Check that MySQL daemon has stopped
# ps -jef | grep mysqld
- Start MySQL as root
# su -
# /usr/libexec/mysqld -Sg --user=root & - Go back into MySQL with the client:
# mysql
mysql> use mysql - Now change the MySQL root password
mysql> UPDATE user SET password=password("newpassword") WHERE user="root";
mysql> flush privileges;
mysql> exit;
- Stop MySQL server.
# killall mysqld
- Verify that MySQL daemon is not running
# ps -jef | grep mysqld
- Start MySQL the normal way, and all is good. For Red Hat this is:
# service mysqld start
- Verify if MySQL daemon is running
# ps -jef | grep mysqld
That's it.
