为什么行匹配但不能用mysql update语句更改?
问题描述:
我已经习惯了MSSQL,而不是Mysql,所以对这个可能很愚蠢的问题感到抱歉.我正在尝试通过运行以下查询来更新备份数据库的密码:
I'm used to MSSQL, not Mysql, so sorry for this probably stupid question. I'm trying update my password for a backup database I'm getting setup by running the following query:
update users set password = md5('pass') where username = 'admin'
当我运行它时说
查询正常,受影响的0行(0.01秒) 匹配的行:1已更改:0警告:0
Query OK, 0 rows affected (0.01 sec) Rows matched: 1 Changed: 0 Warnings: 0
为什么行匹配但没有更改?
Why is a row matching but not changing?
答
这表示该值未更改.可能没有更改,因为该列已经等于pass
的md5哈希值.
It means that the value was not changed. It was probably not changed because the column was already equal to the md5 hash of pass
.