修改mysql的密碼時報錯(Unknown column 'password' in 'field list')

 

mysql> update user set password=password("你的密碼") where user="用戶"; 
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql> update mysql.user set authentication_string=password('你的密碼') where user='用戶';  
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1

mysql> flush privileges; 
Query OK, 0 rows affected (0.00 sec)

mysql> exit;

錯誤的原因是 5.7版本上的mysql數據庫下已經沒有password這個字段了,password字段改成了authentication_string

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章