Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    3

    Unanswered: problem in mysqldump syntax

    So I've finally gotten all of my databases backed using mysqldump. I'm trying to load them back in and everything seems to go fine until I get this error for this chunk of code:

    mysql> CREATE TABLE newsSync (
    -> id int(10) unsigned NOT NULL auto_increment,
    -> artist int(10) unsigned NOT NULL default '0',
    -> database tinytext NOT NULL,
    -> table tinytext NOT NULL,
    -> title tinytext,
    -> body tinytext,
    -> image tinytext,
    -> image_width smallint(5) unsigned default NULL,
    -> image_height smallint(5) unsigned default NULL,
    -> dpost tinytext,
    -> dcreate datetime default '0000-00-00 00:00:00',
    -> UNIQUE KEY artist (artist),
    -> UNIQUE KEY dcreate (dcreate),
    -> KEY id (id)
    -> ) TYPE=MyISAM;
    ERROR 1064: You have an error in your SQL syntax near 'database tinytext NOT NULL,
    table tinytext NOT NULL,
    title tinytext,
    body ' at line 4
    mysql>

    I can't figure out whats wrong with the syntax, expecially since it was output by mysqldump. The version of MySQL I dumped from was 3.23.54 and the version I'm loading into is 3.23.58. What gives?

    --Greg

  2. #2
    Join Date
    Mar 2004
    Posts
    480
    The words database and table are reserved words and should not be used for column names. If you edit the file and put backticks around both column names you will be able to import the file, but you should rename those items afterwards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •