1、错误描述

10:10:38	alter table user add num int(8) primary key first	Error Code: 1068. Multiple primary key defined	0.000 sec

2、错误原因

这个错误的原因是定义了两个主键,导致出错

3、解决办法

alter table user add num int(8) primary key first;

去掉“primary key”

Error Code: 1068. Multiple primary key defined的更多相关文章

  1. mysql:[Err] 1068 - Multiple primary key defined

    添加主键时,出现错误:[Err] 1068 - Multiple primary key defined #增加主键 ) not null; ; alter table my_test add pri ...

  2. Discuz升级 Database Error : pre_common_syscache ADD PRIMARY KEY (cname)【解决办法】

    错误码: 1068Multiple primary key defined Execution Time : 00:00:00:000Transfer Time : 00:00:00:000Total ...

  3. MySQL Error Code文档手册---摘自MySQL官方网站

    This chapter lists the errors that may appear when you call MySQL from any host language. The first ...

  4. EF code first,set composite primary key 复合key问题

    环境: EF core 2.0 Net core 2.0 错误: 因实体定义了多个key,打开数据库时程序报以下错误 An unhandled exception occurred while pro ...

  5. MySQL主从复制中断,报“Error on master: message (format)='Cannot delete or update a parent row: a foreign key constraint fails' error code=1217” 错误

    前几天,发现从库挂了,具体报错信息如下: 分析思路 1. 因为我采用的是选择性复制,只针对以下几个库进行复制: card,upay,deal,monitor,collect.所以,不太可能出现对于sa ...

  6. Error Code: 1452 Cannot add or update a child row: a foreign key constraint fails

    错误: Error Code: 1452 Cannot add or update a child row: a foreign key constraint fails 错误产生情景:我向一张带外键 ...

  7. Error Code: 1175.You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column.

    在MySQL Workbench里面使用SQL语句: delete from 表名 提示出错: Error Code: 1175.You are using safe update mode and ...

  8. mysql主从复制错误:Last_SQL_Error: Error 'Duplicate entry '327' for key 'PRIMARY'' on query. Default database: 'xxx'. Query: 'insert into

    这个算不算解决,我都不太清楚,因为我感觉网上的说法,只是把错误忽略了,不表示以后用从库时不会出问题!!! 解决的办法是在从库上执行: mysql> slave stop; mysql> s ...

  9. Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Queries and reconn

    使用MySQL执行update的时候报错:   MySQL     在使用mysql执行update的时候,如果不是用主键当where语句,会报如下错误,使用主键用于where语句中正常. 异常内容: ...

随机推荐

  1. 结合apache安装subversion

    ########下载源代码包##########wget http://subversion.tigris.org/downloads/subversion-1.6.15.tar.gz;wget ht ...

  2. BZOJ 1367: [Baltic2004]sequence [可并堆 中位数]

    1367: [Baltic2004]sequence Time Limit: 20 Sec  Memory Limit: 64 MBSubmit: 1111  Solved: 439[Submit][ ...

  3. Docker Compose容器编排

    Compose是Docker官方的开源项目,可以实现对Docker容器集群的快速编排.Compose 中有两个重要的概念:服务(service):一个应用的容器,实际上可以包括若干运行相同镜像的容器实 ...

  4. 游戏服务器设计之NPC系统

    游戏服务器设计之NPC系统 简介 NPC系统是游戏中非常重要的系统,设计的好坏很大程度上影响游戏的体验.NPC在游戏中有如下作用: 引导玩家体验游戏内容,一般游戏内有很多主线.支线任务,而任务的介绍. ...

  5. Windows Server 2016-命令行Ntdsutil迁移FSMO角色

    上章节我们介绍了有关图形化界面迁移FSMO角色,进行本章节之前我们首先回顾一下FSMO的五种操作主机角色:架构主机角色(Schema Master).域命名主机角色(Domain Naming Mas ...

  6. 简单的led驱动程序设计

    基于ok6410: led驱动程序: vim led.c #include<linux/kernel.h>#include<linux/module.h>#include< ...

  7. win8 -telnet安装

    控制面板->程序-> 启动或关闭windows功能->选择telnet服务器和telnet客户端->确定 为了安全起见,我们可以设置为手动器用telnet,右键计算机-> ...

  8. ★MySQL一些很重要的SQL语句

    [mysqldumpslow] -s 排序选项:c 查询次数 r 返回记录行数 t 查询时间  -t 只显示top n条查询  mysqldumpslow -s r -t 10000 slow-que ...

  9. Mybatis 动态使用update语句

    update pf_product_audio_t <trim prefix="set" suffixOverrides=","> <if t ...

  10. Yii2中后台用前台的代码设置验证码显示不出来?

    我说的是直接修改advanced模板.细心人会发现模板里在contact里有,登录也想要就仿照contact中的做法.前台好了,后台登录也要验证码,就把前台代码拿过来,可惜前后台的SiteContro ...