Skip to content

Resetting the mySQL root user’s password

June 29, 2010

Follow the process, to Set the root user’s password for mySQL Which is different from the root (system) user:

#/usr/bin/mysqladmin -u root password ‘new-password-here’

If you get “Access denied” for root@localhost try this method:

Stop mysqld:

#service mysqld stop
or
#/etc/init.d/mysqld stop

Start it with:
#/usr/libexec/mysqld –skip-grant-tables –user=mysql

Log onto another terminal or SSH session and run:

#mysql -u root mysql

Enter password:

#mysql> UPDATE user SET Password=PASSWORD(‘newpasswordhere)
-> WHERE User=’root’;

#mysql> FLUSH PRIVILEGES;

#mysql> exit

Then test with:
#mysql -u root -p

Advertisement

From → Linux, mysql

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.