Monday, 19 November 2018

How to change password for a MySQL user

Follow the below MySQL commands to reset the password for a MySQL user. You can change the password for any other users as well with the below commands.
Login with root user in MySQL Database:

[root@linuxcnf ~]# mysql -u root –p

Update the password for a MySQL user with the following command:

mysql> update mysql.user set password=PASSWORD(‘new_password') where User='user_name';

Reload the privileges:

mysql> flush privileges;

Done! Now try to login into MySQL database with the new password.

No comments:

Post a comment