ERROR 1062 (23000): Duplicate entry for key 'PRIMARY'
ALTER TABLE table1 ADD COLUMN column1 VARCHAR(400) DEFAULT NULL;
ERROR 1062 (23000): Duplicate entry '82133627' for key 'PRIMARY'
select * from table1 where <primary_key_field>='82133627';
Primary key - primary_key_field int(11) NOT NULL
solution - need to lock table, and then after running the query unlock it
LOCK TABLES "table1" WRITE;
run the alter table command:
ALTER TABLE table1 ADD COLUMN column1 VARCHAR(400) DEFAULT NULL;
then
UNLOCK TABLES;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28939273/viewspace-2286645/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 從ERROR 1062 (23000) at line Duplicate entry 'R01' for key 'PRIMARY' 能看出什麼Error
- 帝國CMS後臺新增資訊報錯Duplicate entry xx for key PRIMARY
- DUMP-CX_SY_OPEN_SQL_DB-DBSQL_DUPLICATE_KEY_ERRORSQLError
- mysql中key 、primary key 、unique key 與index區別MySqlIndex
- yum error - package is a duplicate withErrorPackage
- on duplicate key update簡單使用
- MySQL_插入更新 ON DUPLICATE KEY UPDATEMySql
- MySQL insert on duplicate key update 死鎖MySql
- 簡單分析MySQL中的primary key功能MySql
- BUG: pymysql executemany不支援insert on duplicate key updateMySql
- SAP MRKO Error - For document type RE, an entry is required in field Reference -ErrorUI
- MySQL 關於 INSERT INTO...ON DUPLICATE KEY UPDATE 的使用MySql
- ios-Multiple commands produced error xcode 10 [duplicate]iOSErrorXCode
- python -- 解決字典【KEY ERROR】PythonError
- MYSQL報1022錯誤:Can't write;duplicate key in table '.....'MySql
- mysql實現merge功能之DUPLICATE key UPDATE語法MySql
- Java中List集合轉Map集合報錯:Duplicate keyJava
- 偶遇ERROR 1071 (42000): Specified key was too long; max key length is 767 bytesError
- 翻譯:insert on duplicate key update(已提交到MariaDB官方手冊)
- fabirc error authorizing update: error validating ReadSet: readset expected key [Group] /Channel/AppErrorAPP
- Q:[Vue warn]: Duplicate keys detected: ‘PAYACT‘. This may cause an update error.VueError
- flutter Error: unable to locate asset entry in pubspec.yaml: "assets/fonts/Lato-Regular.ttf"FlutterErrorYAML
- vue報錯之Duplicate keys detected: '0'. This may cause an update error.VueError
- 【SQL】15 SQL 約束(Constraints)、NOT NULL 約束、UNIQUE 約束、PRIMARY KEY 約束、FOREIGN KEY 約束、CHECK 約束、DEFAULT約束SQLAINull
- percona-toolkit之pt-index-usage和pt-duplicate-key-checker詳解Index
- MySQL 5.6複製報錯Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND;MySqlError
- 【PAT_1062】To Buy or Not to Buy
- 1062 最簡分數
- 小程式 · 報錯:Error: errCode: -501007 ,errMsg: Invalid Key Name (__keyPath)Error
- HTML Entry 原始碼分析HTML原始碼
- panic: assignment to entry in nil map
- PAT-B 1062 最簡分數
- RuntimeError: Error(s) in loading state_dict for SSD: Missing key(s) in解決辦法Error
- [專案踩坑] MySQL 分割槽:分割槽鍵和唯一索引主鍵的關係,解決報錯 A PRIMARY KEYMySql索引
- Tkinter (05) 輸入部件 Entry
- 序列中最大的數(51Nod-1062)
- “alter database switchover to xx“過程不當導致的primary-primary 雙主問題Database
- [LeetCode] Find the Duplicate NumberLeetCode