简体   繁体   中英

mySQL Table ERROR 1064

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?

You should replace single quotes with back-ticks ie `:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM