Home Download Ubuntu

How to change MySQL root password in Ubuntu

Using terminal, type in the following:

sudo mysql -u root -p


After you login:

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';


FLUSH PRIVILEGES;


You may quit mysql:

quit


Explanation:

MyNewPass id the new password for MySQL and root is your current MySQL user.

The UPDATE statement resets the password for all existing root accounts, and the FLUSH statement tells the server to reload the grant tables into memory.

Resources MySQL.com

0 comments:

Post a Comment