How To Change The Root Password In MySQL

Published Date Author: , Posted October 26th, 2011 at 10:22:04am

Using mysqladmin on the command line

If you have never set a root password for MySQL server, the server does not require a password at all for connecting as root.

To set the root password for the first time, use mysqladmin:

However, if you want to change (or update) a root password, then you need to use the following command:

For example, to change the password from foo to bar:

Using SQL commands at the mysql prompt

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.