Mysqladmin Change Password

Here is a quick tip on how to change mysql password for root using mysqladmin.

Mysqladmin change root password

First, you want to stop the mysql daemon.

# /etc/init.d/mysql stop

Second, issue a command to allow you to change the mysql root password by skipping the tables that grant permissions.

# mysqld --skip-grant-tables

Next, using mysqladmin you can now change the root password

# mysqladmin -u root password 'newpasswd'

That’s it! Now you can start the mysql daemon again.

# /etc/init.d/mysql start

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>