Home > Database > Mysql Tutorial > How to change the login password in mysql8?

How to change the login password in mysql8?

青灯夜游
Release: 2020-10-12 13:42:41
Original
8238 people have browsed it

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.

How to change the login password in mysql8?

(Recommended tutorial: mysql video tutorial)

How to change the login password in mysql8?
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
输入登录密码
Copy after login

2. Use the mysql database

USE mysql
Copy after login

3. Change the password

ALTER USER 'test'@'localhost' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY '新密码';
Copy after login

4. Verify whether the change is successful

mysql -u test -p
输入新密码
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template