SQL Table Error Magento



这是非常奇怪的,谁有一个答案,为什么这给出了一个错误?

 ------------------------------------------------------ --
--
 -- Table structure for table `mg_cataloginventory_stock`
--
  CREATE TABLE IF NOT EXISTS  `mg_cataloginventory_stock` (
`stock_id` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT  'Stock Id',
`stock_name` VARCHAR( 255 ) DEFAULT NULL COMMENT  'Stock Name',
 PRIMARY KEY (  `stock_id` )
) ENGINE = INNODB DEFAULT CHARSET = utf8 COMMENT =  'Cataloginventory Stock';
MySQL said: Documentation
#1064 - 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 '--------------------------------------------------------
--
 -- Table structu' at line 1 

看来你的SQL注释语法不正确。

从"——"序列到行尾。在MySQL中,"——"(双破折号)注释样式要求第二个破折号后面至少有一个空白或控制字符(如空格、制表符、换行符等)。

应该是这样的:

-- ------------------------------------------------------
--
-- Table structure for table `mg_cataloginventory_stock`
--

最新更新