Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

03-set the root password

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1)。 Set the root password for the first time (the default root password is empty)

one

[root@mysql1] # mysqladmin-uroot password '123456'

2)。 Modify root password

one

[root@mysql1] # mysqladmin-uroot-p123456 password '123456789'

one

[root@mysql1] # mysqladmin-uroot-p123456789 password 'hua19900822**'

3) .set password set password

one

two

three

four

five

Mysql > set password=password ('123456'); # change password

Query OK, 0 rows affected (0.00 sec)

Mysql > flush privileges; # synchronize to disk

Query OK, 0 rows affected (0.00 sec)

4) .update statement to change the password

one

two

three

four

five

six

seven

eight

nine

ten

eleven

twelve

thirteen

fourteen

fifteen

sixteen

seventeen

eighteen

nineteen

twenty

twenty-one

Mysql > use mysql

Database changed

Mysql > select user,host,password from user

+-- +

| | user | host | password | |

+-- +

| | root | localhost | * 6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |

| | root | mysql1 |

| | root | 127.0.0.1 |

| | root |:: 1 |

| | localhost |

| | mysql1 |

+-- +

6 rows in set (0.00 sec)

Mysql > update user set password=PASSWORD ('789789') where user='root' and host='localhost'

Query OK, 1 row affected (0.00 sec)

Rows matched: 1 Changed: 1 Warnings: 0

Mysql > flush privileges

Query OK, 0 rows affected (0.00 sec)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report