ERROR 1820 set password for root@'db'=password("1q2w3e4r")

来源:互联网 发布:手机不让安装软件 编辑:程序博客网 时间:2024/06/18 13:18

[root@db software]# rpm -ivh MySQL-server-advanced-5.6.22-1.rhel5.x86_64.rpm 

[root@db software]# service mysql start

Starting MySQL.[  OK  ]

[root@db software]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.22-enterprise-commercial-advanced
Copyright (c) 2000, 2014, 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> show databases;

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

mysql> set password for root@'db'=password("123456");
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

[root@db software]# ping db
PING db (127.0.0.1) 56(84) bytes of data.
64 bytes from db (127.0.0.1): icmp_seq=1 ttl=64 time=0.127 ms
64 bytes from db (127.0.0.1): icmp_seq=2 ttl=64 time=0.020 ms

mysql> set password=password("1q2w3e4r");
Query OK, 0 rows affected (0.00 sec)


mysql> exit

[root@db software]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.6.22-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2014, 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> 
mysql> 
mysql>  show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+


0 0
原创粉丝点击