mysql修改root密码

[root@typecodes ~]# mysql -u root -p [使用root用户登录]

Enter password:  

[无密码,直接回车]

Welcome to the MySQL monitor.  

Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.7.6-m16

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> select * from mysql.user;

ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

mysql> set password='this is a password sample';

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

######设置当前root用户密码

mysql> set password='MYSQLroota7612198981@';

Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

你可能感兴趣的:(mysql修改root密码)