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;
ERROR 1062 (23000): Duplicate entry for key 'PRIMARY'的更多相关文章
- ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'
use mysql mysql> select host, user from user; 将相应用户数据表中的host字段改成'%': update user set host='%' whe ...
- ERROR 1062 (23000): Duplicate entry '0' for key 'PRIMARY'
OS: centos 6.3DB: 5.5.14 测试创建yoon测试表,没有主键,没有索引,基础数据内容如下: mysql> select * from yoon;+----+-------- ...
- RDS 在线DDL诡异报错ERROR 1062 (23000): Duplicate entry
RDS上执行报错如下: MySQL [ad_billing]> ALTER TABLE ad_spending ADD COLUMN impr bigint(20) NOT NULL DEFAU ...
- ERROR 1062 (23000): Duplicate entry '1-1' for key 'PRIMARY'
这个错误是说,由于某个SQL操作造成了,表中主键重复. 例子: create table t(x int,y int,z int, primary key(x,y)); insert into t(x ...
- Duplicate entry '' for key 'PRIMARY'
今天在在mysql中插入数据 因为直接插入查询出来的表格,insert into 表(student_id,class_id) 直接插入了这两个字段对应的查询出来的表 没有留意到该表的主键没有设置自增 ...
- sqlalchemy.exc.IntegrityError: (mysql.connector.errors.IntegrityError) 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
排错: 看到 Duplicate entry '1' for key 'PRIMARY'是主键错误 看一看自己添加的数据id是1 再查询一下数据库中的表,发现id=1的记录已经存在了 所以在代码中让i ...
- java向数据库插入数据时的错误: Duplicate entry '' for key 'PRIMARY' 问题解决
错误提示为:你插入的记录与数据表中原有记录的主键重复了(Duplicate).所以插入失败 mysql主键设置成auto_increment时,进行并发性能测试出现主键反复Duplicate entr ...
- 数据库出错提示Duplicate entry * for key *的解决方法
错误编号:1062 错误提示: 查询语句错误] ERR: Duplicate entry ' for key 'PRIMARY' SQL: ' PHP: misc.php: ; IP 问题分析: 向唯 ...
- Duplicate entry * for key *
一.问题 插入数据时报错 Duplicate entry * for key * 二.分析 建表语句 CREATE TABLE `t_product_result_config` ( `id` var ...
随机推荐
- PAT_A1120#Friend Numbers
Source: PAT A1120 Friend Numbers (20 分) Description: Two integers are called "friend numbers&qu ...
- PAT_A1087#All Roads Lead to Rome
Source: PAT A1087 All Roads Lead to Rome (30 分) Description: Indeed there are many different tourist ...
- python 从给定的URL中提取顶级域名(TLD)
安装 PyPI的最新稳定版本: pip install tld 或者GitHub的最新稳定版本: pip install https://github.com/barseghyanartur/tld/ ...
- node源码详解(三)
本作品采用知识共享署名 4.0 国际许可协议进行许可.转载保留声明头部与原文链接https://luzeshu.com/blog/nodesource3 本博客同步在https://cnodejs.o ...
- 【codeforces 793C】Mice problem
[题目链接]:http://codeforces.com/contest/793/problem/C [题意] 给你每个点x轴移动速度,y轴移动速度; 问你有没有某个时刻,所有的点都"严格& ...
- (29)Spring boot 文件上传(多文件上传)【从零开始学Spring Boot】
文件上传主要分以下几个步骤: (1)新建maven java project: (2)在pom.xml加入相应依赖: (3)新建一个表单页面(这里使用thymleaf); (4)编写controlle ...
- Spring Boot-定义拦截器(七)
在web项目 我们常常使用拦截器做权限验证和登陆验证 1.创建一个拦截器实现类 标注@Componet @Component public class LoginInterceputer implem ...
- hdu 1250 简单大整数加法
#include<stdio.h> #include<string.h> #define N 3100 int a[N],b[N],c[N],d[N],e[N]; int ma ...
- ExtJs之Ext.Model的MemoryProxy
书上的代码已完全不可参考,只好按知识点从网上查资料一个一个实例 了. <!DOCTYPE html> <html> <head> <title>ExtJ ...
- DLR概念
参考文章 动态语言运行时(Dynamic Language Runtime,DLR)是一套基于.NET的类库,它的作用是简化在CLR上开发动态语言的工作,例如DLR中提供了表达式树的创建,代码生成.优 ...