`

Cent OS linux mysql 登陆失败 修改密码

 
阅读更多

[root@dbserver latte]# service mysql stop
Shutting down MySQL..                                      [  确定  ]
[root@dbserver latte]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[root@dbserver latte]# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.26 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql
Database changed
mysql> UPDATE user SET Password=PASSWORD('123456')where USER='mysql';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0  Changed: 0  Warnings: 0
mysql> quit
Bye

mysql> select host,user,password from mysql.user
+-----------+------+-------------------------------------------+
| host      | user | password                                  |
+-----------+------+-------------------------------------------+
| localhost | root | *BC7677BF50E4EA779C30A77CBB58DFD4DC24BD40 |
| dbserver  | root | *BC7677BF50E4EA779C30A77CBB58DFD4DC24BD40 |
| 127.0.0.1 | root | *BC7677BF50E4EA779C30A77CBB58DFD4DC24BD40 |
| ::1       | root | *BC7677BF50E4EA779C30A77CBB58DFD4DC24BD40 |
+-----------+------+-------------------------------------------+
mysql> desc mysql.user;

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics