tro*_*jek 2 mysql database relational-database
我有包含许多表的数据库,其中一个称为 group 是由代码创建的:
CREATE TABLE IF NOT EXISTS `sc`.`group` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`description` TEXT NULL,
`group_type_id` INT NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_group_group_type1`
FOREIGN KEY (`group_type_id`)
REFERENCES `sc`.`group_type` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE INDEX `fk_group_group_type1_idx` ON `sc`.`group` (`group_type_id` ASC);
Run Code Online (Sandbox Code Playgroud)
当我使用命令 show tables 时,我得到:
+-------------------------------------+
| event_type |
| function |
| group |
| group_admin |
...
...
+-------------------------------------+
Run Code Online (Sandbox Code Playgroud)
例如describe function;,如果我写:,mysql 返回:
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(45) | YES | | NULL | |
+-------+-------------+------+-----+---------+----------------+
Run Code Online (Sandbox Code Playgroud)
但是如果我写describe group;我得到一个错误:
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 'group' at line 1
我无法对group表进行任何操作(例如选择、插入)。
它有什么问题?
| 归档时间: |
|
| 查看次数: |
2225 次 |
| 最近记录: |