MySQL Change Password Tip

I keep getting the question on how to change a mysql root password. Here is a quick tip on how to change the MySQL password from the command line.

# /etc/init.d/mysql stop
# mysqld --skip-grant-tables
# mysqladmin -u root password 'newpass'
# /etc/init.d/mysql start

Change MySQL Password for a standard user

You can also change the mysql password for a standard user using mysqladmin.

# mysqladmin -u username -p oldpass newpass

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>