If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > problem in mysqldump syntax

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-07-04, 19:46
formasfunction formasfunction is offline
Registered User
 
Join Date: Jul 2004
Posts: 3
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
Reply With Quote
  #2 (permalink)  
Old 07-08-04, 07:51
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On