How to update MySQL password?

Steps to update the MySQL Password -

1. First stop MySQL service by following command.
    #service msyqld stop
    OR
   #service mysql stop

2. Then we need to start up MySQL in safe mode, so we will skip the privileges table:
   #mysqld_safe --skip-grant-tables 

3. Now, Login with root:
   #mysql -uroot

4. Assign the DB that needs to be used:
   #use mysql;

5. Now all we have to do is reset your root password of the MySQL user and restart the MySQL service:
   update user set password=PASSWORD("YOURPASSWORDHERE") where User='root';
   flush privileges;
   quit and restart MySQL:

6. Now, start the MySQL
   #/etc/init.d/mysql start

7. Now, we are able to access MySQL by using reset password.
   #mysql -u root -p
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to run the backup process which is stuck using rsync?

While running the backup process, I was getting the error message as - /usr/bin/rsync -rlptD...

How to perform the Linux Sever Hardening?

1. Check the hostname is setup or not - hostname 2. Check the IP address is assigned to hostname...

How to install latest version of git on CentOS release 6.8 (Final)?

Install latest version of git on CentOS release 6.8 - Step 1. Install Dependencies - yum install...

How to setup PPTP VPN?

A Point-To-Point Tunneling Protocol (PPTP) allows you to implement your own VPN very quickly, and...

How to fix Amazon S3-RequestTimeTooSkewed?

If you have configured a Amazon S3 backup server under cPanl backup configuration to upload...

Powered by WHMCompleteSolution