MGR需要使用主键

验证MGR架构表需要使用主键,不然插入数据会报错。

十年专注成都网站制作,成都企业网站定制,个人网站制作服务,为大家分享网站制作知识、方案,网站设计流程、步骤,成功服务上千家企业。为您提供网站建设,网站制作,网页设计及定制高端网站建设服务,专注于成都企业网站定制,高端网页制作,对雨棚定制等多个方面,拥有丰富的网站运维经验。

MySQL> show tables;
+--------------+
| Tables_in_dd |
+--------------+
| a            |
+--------------+
1 row in set (0.00 sec)

mysql> desc a;
+-------+---------+------+-----+---------+-------+
| Field | Type    | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| id    | int(11) | YES  |     | NULL    |       |
+-------+---------+------+-----+---------+-------+
1 row in set (0.00 sec)

mysql> insert into a values(1);
ERROR 3098 (HY000): The table does not comply with the requirements by an external plugin.

mysql> alter table a add primary key (id);
Query OK, 0 rows affected (0.02 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> desc a;
+-------+---------+------+-----+---------+-------+
| Field | Type    | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| id    | int(11) | NO   | PRI | NULL    |       |
+-------+---------+------+-----+---------+-------+
1 row in set (0.01 sec)

mysql> insert into a values(1);
Query OK, 1 row affected (0.00 sec)
mysql> insert into a values(1);
Query OK, 1 row affected (0.00 sec)

mysql> select * from a;
+----+
| id |
+----+
|  1 |
+----+
1 row in set (0.00 sec)

分享题目:MGR需要使用主键
新闻来源:http://bzwzjz.com/article/jeiedo.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都网站建设 成都网站设计 手机网站建设套餐 成都营销网站制作 成都网站建设 成都品牌网站设计 教育网站设计方案 成都网站制作 重庆企业网站建设 定制网站建设多少钱 成都品牌网站建设 定制网站建设 H5网站制作 高端网站设计 泸州网站建设 成都网站建设 网站建设公司 营销型网站建设 手机网站建设 成都网站建设公司 成都网站设计 成都企业网站设计