Home >Database >Mysql Tutorial >How to set mysql login password?
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.
mysql settings password
There are many ways:
1. After entering mysql with root
mysql>set password =password('你的密码'); mysql>flush privileges;
2. Use the GRANT statement
mysql>grant all on *.* to 'root'@'localhost' IDENTIFIED BY '你的密码'with grant option ; mysql>flush privileges;
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;
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!