Change the password to connect to the database on Linux

1. Have the original root password of mysql

 

Method ① Log into the mysql system

Enter the command: mysql -u root -p

Enter password:(newpassword)

Enter mysql to write mysql statement

Use mysql

change Password

Make it effective

Quit mysql

Method ②

Outside of MySQL, use commands to modify

Enter password: (Enter new password)

Published 105 original articles · Like 536 · Visits 70,000+

Guess you like

Origin blog.csdn.net/qq_41934990/article/details/81703972
Recommended