Home > Database > Mysql Tutorial > How to set mysql login password?

How to set mysql login password?

青灯夜游
Release: 2020-09-30 11:19:17
Original
11683 people have browsed it

Setting method: 1. Use the "set password =password('your password');" command; 2. Use the "update user set password=password('your password') where user='root ';"Order.

How to set mysql login password?

mysql settings password

There are many ways:

1. After entering mysql with root

mysql>set password =password('你的密码');
mysql>flush privileges;
Copy after login

2. Use the GRANT statement

mysql>grant all on *.* to 'root'@'localhost' IDENTIFIED BY '你的密码'with grant option ; 
mysql>flush privileges;
Copy after login

3. Enter the mysql library to modify the user table

mysql>use mysql;
mysql>update user set password=password('你的密码') where user='root';
mysql>flush privileges;
Copy after login

Recommended tutorial: mysql video tutorial

The above is the detailed content of How to set mysql login password?. 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