修改用戶的密碼,網上搜到的命令爲以下mysql
執行後報錯 ERROR 1054(42S22) Unknown column 'password' in ‘field list’sql
錯誤的緣由是 5.7版本下的mysql數據庫下已經沒有password這個字段了,password字段改爲了authentication_string數據庫
因此請使用一下命令spa
>mysql -u root -p Enter password: ********
mysql> use mysql; Database changed
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
此博文非原創string