Change MySQL Root Password

Change MySQL Root Password

Forgot the MySQL root password :

First you will have to stop the MySQL service on the server.

# service mysqld stop

Start MySQL as

# /usr/bin/safe_mysqld skip-grant-tables &

Or

# /usr/bin/mysqld_safe skip-grant-tables &

safe_mysqld is a script that starts mysqld and traps any forceful termination of the MYSQL server and it prevents any database corruption.

Change the password for root user as

# mysql -u root mysqlmysql> UPDATE user SET Password=PASSWORD(new_password) WHERE user=root

mysql> FLUSH PRIVILEGES;

mysql> exit;

Start the MySQL service:

# service mysqld start

Visit the WHUK website for more news, knowledge base articles, blog posts and information on our wide range of hosting services.

Sharing

Pin It on Pinterest

Share This