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条)

报告相同问题?

悬赏问题

  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn