You can use the MySQL command line to change the password of a MySQL database through the MySQL command line. The following describes the MySQL Command Line in detail. If you are interested, take a look. Format: mysqladmin-u username-p old password new password 1. Add a password 1111 to the root user. First, enter the mysql \ bin directory in DOS, and then type the following command mysqladmin-u root-password 1111 Note: because the root has no password at the beginning, therefore, the old-p password can be omitted. Www.2cto.com 2. Change the root password to 1234. Mysqladmin-u root-p ab12 password 1234 (Note: Unlike the above, the following commands in the MYSQL environment are followed by a semicolon as the command Terminator) 3. Run the command line to change the root password: mysql> UPDATE mysql. user SET password = PASSWORD ('new password') WHERE User = 'root'; mysql> flush privileges; 4. display the current user: mysql> select user ();