Mysql8 method to change the login password: 1. Log in to mysql; 2. Use the "ALTER USER 'test'@'localhost' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY 'new password';" command to change the password.
(Recommended tutorial: mysql video tutorial)
Example: Modify the mysql database The login password of the test user in the user table.
MySQL version number: 8.0.15
Steps:
1. Log in to mysql
mysql -u root -p 输入登录密码
2. Use the mysql database
USE mysql
3. Change the password
ALTER USER 'test'@'localhost' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY '新密码';
4. Verify whether the change is successful
mysql -u test -p 输入新密码
The above is the detailed content of How to change the login password in mysql8?. For more information, please follow other related articles on the PHP Chinese website!