mysql 中key 指的是索引

来源:互联网 发布:若风淘宝店服装店网址 编辑:程序博客网 时间:2024/04/28 09:43

mysql> create table t100(id int);
Query OK, 0 rows affected (0.43 sec)

mysql> create table t100_idx1 on t100(id);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘on t100(id)’ at line 1
mysql> create index t100_idx1 on t100(id);
Query OK, 0 rows affected (0.17 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> show create table t100\G;
***************** 1. row *****************
Table: t100
Create Table: CREATE TABLE t100 (
id int(11) DEFAULT NULL,
KEY t100_idx1 (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.01 sec)

ERROR:
No query specified

0 0
原创粉丝点击