Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem in restoration syntax 1

Status
Not open for further replies.

formasfunction

Technical User
Jul 6, 2004
7
US
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?

Thanks again for everyone's help here. You're helping me limp out of the hole I've dug for myself!

--Greg
 
database is a reserved word. i think you can quote it '' or maybe backtick it ``. either way, i'm pretty confident that that's the problem.

(when you are restoring, mysql sees 'database' and thinks that you are referring to a database object, not a column name)

----
JBR
 
That was exactly it! I should have know. I didn't create this database, sorta inherited it, so now I have to go about fixing everything!

Thanks again,
Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top