mySQL Table ERROR 1064

蓝咒 提交于 2019-12-08 14:10:48

问题


CREATE TABLE 'geodata' (
  'Id' char(16) NOT NULL,
  'Type' smallint(6) DEFAULT NULL,
  'Description' varchar(200) DEFAULT NULL,
  'Url' varchar(400) DEFAULT NULL,
  'Location' point DEFAULT NULL,
  PRIMARY KEY ('Id')
);

ERROR 1064:

'Id' char(16) NOT NULL,
'Type' smallint(6) DEFAULT NULL, at line1.

I don't know whats wrong with my table can someone explain?


回答1:


You should replace single quotes with back-ticks i.e `:

CREATE TABLE `geodata` (
 `Id` char(16) NOT NULL,
 `Type` smallint(6) DEFAULT NULL,
 `Description` varchar(200) DEFAULT NULL,
 `Url` varchar(400) DEFAULT NULL,
 `Location` point DEFAULT NULL,
  PRIMARY KEY (`Id`)
); 

SQLFiddle




回答2:


Just replace the ' with `. Or just remove the '.



来源:https://stackoverflow.com/questions/23464437/mysql-table-error-1064

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!