How to set the mysql password after successful installation?

How to set the mysql password after successful installation?

After a successful installation in accordance with the installation tutorial, the default is no password.

Command line:

mysql -u root -p

You can successfully log in, suggesting welcome to the mysql monitor! The word means that the login is successful.

Close the current command line, restart cmd.exe

Enter mysqladmin -u root -p password

Enter,

Appears "Enter password:", hit enter, there is no default password when the password is not set,

Then came "New password:" Enter the new password and press Enter,

Confirm the password, press Enter: "Confirm new password" then appears.

After completion change the password, the next re-logged,

Type mysql -u root -p can then enter a password to log on after setting.

Guess you like

Origin www.cnblogs.com/lazb/p/12544135.html