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://csruizhi.cn/article/jeiedo.html

其他资讯

Copyright © 2007-2024 成都优众联杰科技有限公司 All Rights Reserved 蜀ICP备2024116266号
友情链接: 成都网站设计制作公司 成都网站设计公司 网站建设改版 网站设计 成都商城网站建设 四川成都网站设计 成都网站制作 手机网站建设套餐 网站制作 响应式网站设计 成都网站建设 移动网站建设 H5网站制作 网站建设公司 四川成都网站制作 响应式网站设计 成都网站建设流程 重庆企业网站建设 手机网站制作设计 成都网站制作 网站建设方案 成都网站建设