[英]Difference for MySQL Error Code 1062 verses 1022
Review of MySQL error codes has me confused about the difference between 1022 and 1062 (see https://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html ). 查阅MySQL错误代码使我对1022和1062之间的区别感到困惑(请参阅https://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html )。 I currently don't have access to a test MySQL DB to investigate further.
我目前无法访问测试MySQL数据库以进行进一步调查。
So, what is the difference between MySQL error code 1022 and 1062 (they both say dup key)? 那么,MySQL错误代码1022和1062(它们都说dup键)之间有什么区别?
What gets raised for an attempted insert of an existing Primary Key? 尝试插入现有主键会引发什么?
What gets raised for an attempted insert of an existing Unique Key that is not a Primary Key? 尝试插入不是主键的现有唯一键会引起什么?
Differences between 1062 and 1022 error codes: 1062和1022错误代码之间的区别:
MySQL reference: MySQL参考:
Error: 1022 SQLSTATE: 23000 (ER_DUP_KEY)
Message: Can't write; duplicate key in table '%s'
Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
Message: Duplicate entry '%s' for key %d
MySQL NET constants: MySQL NET常数:
MySqlErrorCode.DuplicateKey = 1022;
MySqlErrorCode.DuplicateKeyEntry = 1062;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.