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. requestAnimationFrame的用法

    该方法用于在浏览器中制作动画.通过递归调用同一方法来不断更新画面以达到动起来的效果,但它优于setTimeout/setInterval的地方在于它是由浏览器专门为动画提供的API,在运行时浏览器会自 ...

  2. iOS-CYLTabBarController【好用的TabbarController】

    用TabbarController进行模块分类和管理,这里推荐一个CYLTabBarController,只需两个数组就可以使用和管理: 1.导入CYLTabBarController 使用cocoa ...

  3. BZOJ 3786: 星系探索 [伪ETT]

    传送门 数据,标程 题意: 一颗有根树,支持询问点到根路径权值和,子树加,换父亲 欧拉序列怎么求路径权值和? 一个点的权值只会给自己的子树中的点贡献,入栈权值正出栈权值负,求前缀和就行了! 和上题一样 ...

  4. 一个巨low的“2048”

    代码就是这样,做的不是4*4而是一个2*2 #include<stdio.h>#include<stdlib.h>#include<time.h>int main( ...

  5. Windows Server 2016-Powershell迁移FSMO角色

    上一章节我们讲到了通过Ntdsutil命令行进行FSMO角色迁移,本章开始之前我们先讨论一下有关FSMO角色放置建议: 建议将架构主机角色(Schema Master)和域命名主机角色(Domain ...

  6. yii2 源码分析Event类分析 (三)

    转载请注明链接:http://www.cnblogs.com/liuwanqiu/p/6739880.html Event是所有事件的基类,它继承Object类 Event类上面的注释的大致意思: * ...

  7. nginx上支持.htaccess伪静态的配置实例

    本文介绍下,在nginx上配置.htaccess伪静态的方法,有需要的朋友参考下吧. 在apache上.htaccess转向,只要apache编译的时候指明支持rewrite模块即可. 但是换到ngi ...

  8. 03-PHP-memcached

    [安装memcached] [安装 libevent] $ tar zxvf libevent-2.0.20-stable.tar.gz $ cd libevent-2.0.20-stable/ $ ...

  9. How to delete a VM with snapshots

    A note about error: "cannot delete inactive domain with snapshots" You cannot delete a VM ...

  10. word在页眉中插入页码

    编辑页眉时,插入-页码-当前位置-普通数字