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 install AVG Antivirus scanner on Ubuntu?

AVG free is antivirus which protects from spyware as well malware. It is free to use for private...

How to setup a WordPress website on plain Centos server?

The following steps have been successfully tested on a plain centos server. Now lets start...

How to change the port number of Apache Web Server?

Default port to access the Apache is 80. Secure port for communicating with world for Apache is...

How to install Postfix on CentOS?

Postfix is an open-source Mail Transport Agent (MTA), which supports protocols like LDAP, SMTP...

How to install SOAP on CentOS?

Install SOAP on CentOS 1) Fire below command - yum install php-soap Output will be as follow...

Powered by WHMCompleteSolution