Step 1: Enter the directory: cd /etc/mysql, check the debian.cnf file
Step 2: Log in to MySQL using the account password in the figure above.
The third step: View the library in the database.
Step 4: Use the mysql library.
Step 5: Use the following statement to set the account password: update user set authentication_string=PASSWORD("Custom new password") where user='root';
My personal setting is simple. The account is root. Password: 123456.
Step 6: Execute the following statement: update user set plugin="mysql_native_password";
Step 7: Refresh: flush privileges;
Step 8: Exit: quit;
Step 9: The password modification is complete. Enter :/etc/init.d/mysql restart;
in the command box to restart MySQL
The last step: log in again. Congratulations on your success in changing the default password.
to sum up
The above are the steps for installing MySQL to change the default password in Ubuntu introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply to you in time. Thank you very much for your support to the ZaLou.Cn website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!
Recommended Posts