dongzhenge2014 2017-04-29 17:22
浏览 213
已采纳

MySQL说:文档#1064你的SQL语法有错误[关闭]

I'm trying to move my eCommerce website I created my self from a WAMPSERVER localhost to my online host.
In order to move the database(which was working perfectly on my localhos), I export it as an sql file,Then I created a new database in my online server to import the database sql file.
The problem I get after hit import is this :

ErrorSQL query:

-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE  `users` (

 `UserID` INT( 11 ) NOT NULL COMMENT  'To Identify User',
 `Username` VARCHAR( 255 ) NOT NULL COMMENT  'Username To Login',
 `Password` VARCHAR( 255 ) NOT NULL COMMENT  'Password To Login',
 `Email` VARCHAR( 255 ) NOT NULL COMMENT  'User Email',
 `FullName` VARCHAR( 255 ) NOT NULL COMMENT  'User Full name',
 `GroupID` INT( 11 ) NOT NULL DEFAULT  '0' COMMENT
);

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 ')' at line 14

What is the problem ?

UPDATE : The problem solved after adding the comment, but I'm getting another error messages like this :

    Error
SQL query:

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE  `users` MODIFY  `UserID` INT( 11 ) NOT NULL AUTO_INCREMENT ,
AUTO_INCREMENT =9 COMMENT  'To Identify User';


MySQL said: Documentation

#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key 
  • 写回答

2条回答 默认 最新

  • douzhanbai9526 2017-04-29 17:26
    关注

    the problem is in the last line you need to set a COMMENT 'your comment ' or completely remove COMMENT

     CREATE TABLE  `users` (
    
     `UserID` INT( 11 ) NOT NULL COMMENT  'To Identify User',
     `Username` VARCHAR( 255 ) NOT NULL COMMENT  'Username To Login',
     `Password` VARCHAR( 255 ) NOT NULL COMMENT  'Password To Login',
     `Email` VARCHAR( 255 ) NOT NULL COMMENT  'User Email',
     `FullName` VARCHAR( 255 ) NOT NULL COMMENT  'User Full name',
     `GroupID` INT( 11 ) NOT NULL DEFAULT  '0' COMMENT 'group id'
    );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条