update user set password=password(“新密碼”) where user=”用戶名”; 執(zhí)行后報(bào)錯(cuò)  ERROR 1054(42S22) Unknown column password in ‘field list’..."/>
溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Mysql5.7.18.1修改用戶密碼報(bào)錯(cuò)ERROR 1054 (42S22):

發(fā)布時(shí)間:2020-06-06 13:32:59 來(lái)源:網(wǎng)絡(luò) 閱讀:460 作者:BonnieJason 欄目:MySQL數(shù)據(jù)庫(kù)
mysql> update user set password=password(“新密碼”) where user=”用戶名”;
執(zhí)行后報(bào)錯(cuò)  ERROR 1054(42S22) Unknown column 'password' in ‘field list’

錯(cuò)誤的原因是 5.7版本下的mysql數(shù)據(jù)庫(kù)下已經(jīng)沒(méi)有password這個(gè)字段了,password字段改成了authentication_string

所以請(qǐng)使用一下命令:

mysql -u root -p

Enter password: **
**Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.7.18-log MySQL Community Server (GPL)**
Copyright (c) 2000, 2017, 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> use mysql;
Database changed
mysql> select User from user; #此處為查詢用戶命令
--------- | User |
--------- | * | | mysql.sys | | root |
**---------**
rows in set (0.00 sec)
mysql> update user set password=password("*") where user="*"; #修改密碼報(bào)錯(cuò)
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> quit
Bye

n>mysql -u * -p #以該用戶登錄成功.
Enter password:
…………………………
mysql>

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI