【发布时间】:2014-01-15 11:20:32
【问题描述】:
MySql 中有以下代码块:
DROP TABLE IF EXISTS `account.info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `account.info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`account_id` int(11) NOT NULL,
`year_id` int(11) NOT NULL,
`school_id` int(11) NOT NULL,
PRIMARY KEY (`id`,`account_id`,`year_id`,`school_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7177 DEFAULT CHARSET=utf8;
它在第一行给我错误:
ERROR 1103 (42000) at line 56: Incorrect table name 'account.info'
这有什么问题?
请帮帮我。
【问题讨论】:
-
可能是 ` Try to do a select statement on that table.
-
我认为您的语法稍有偏差。请参阅here `DROP TABLE IF EXISTS 'account'.'info' dbname 和 table name 在单独的引号中。
-
你为什么要关心表是否存在。只需运行
DROP语句即可捕获错误。然后创建。无论哪种方式,你都会得到你的结果...... -
@LOLSinger:您的数据库中似乎需要
account_info表,但account数据库中不需要info表。 -
@LOLSinger:将
account.info替换为account_info,它应该可以工作。