MYSQL Error:You must SET PASSWORD before execut...

利用安全模式成功登錄,而後修改密碼,等於給MySql設置了密碼。登錄進去後,顯示全部數據庫。獲得的結果確實: html

ERROR 1820 (HY000): You must SET PASSWORD before executing this statement 很是詭異啊,明明用密碼登錄進去了,怎麼還提示須要密碼。
參考官方的一個文檔,見http://dev.mysql.com/doc/refman/5.6/en/alter-user.html。以下操做後就ok了: mysq> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql> SET PASSWORD = PASSWORD('root'); 
Query OK, 0 rows affected (0.03 sec)
mysql> show databases;
+------------------------------+
| Database                     |
+------------------------------+
| information_schema           |
| mysql                        |
| performance_schema           |
| test                         |
+------------------ -----------+
4 rows in set (0.11 sec) 

也就是用mysql>  SET PASSWORD = PASSWORD('root');這句話從新設置一次密碼! mysql

相關文章
相關標籤/搜索