2

We have a client that has had their servers for soo long, they were still running MySQL 4.0.24.
Now that they are refreshing their servers, we took a mysqldump of their current database to put into the new servers and are getting errors like:

ERROR 1064 (42000): You have an error in your SQL syntax; check the 
manual that corresponds to your MySQL server version for the right 
syntax to use near 'call' at line 1
ERROR 1064 (42000): You have an error in your SQL syntax; check the 
manual that corresponds to your MySQL server version for the right 
syntax to use near 'call
(
path varchar(255) NOT NULL default '',
call_num int(12) unsigned ' at line 1

The section of the dump file it is complaining about is:

--
-- Table structure for table `call`
--

DROP TABLE IF EXISTS call;
CREATE TABLE call (
  path varchar(255) NOT NULL default '',
  call_num int(12) unsigned NOT NULL auto_increment,
  date datetime NOT NULL default '0000-00-00 00:00:00',
  idf varchar(4) NOT NULL default '404',
  location varchar(255) default NULL,
  who_req varchar(8) default NULL,
  who_res varchar(8) default NULL,
  PRIMARY KEY  (path,call_num)
) ENGINE=MyISAM;

--
-- Dumping data for table `call`
--

So, does anyone have any ideas on this one?

RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536
B.Kaatz
  • 141
  • 7

1 Answers1

2

Well,

I figured out that if you use the backticks ("`") around the table name (like mysqldump uses in the comment-separator sections, e.g. `call`), it works as expected.

So, the above should look like:

--
-- Table structure for table `call`
--

DROP TABLE IF EXISTS `call`;
CREATE TABLE `call` (
  path varchar(255) NOT NULL default '',
  call_num int(12) unsigned NOT NULL auto_increment,
  date datetime NOT NULL default '0000-00-00 00:00:00',
  idf varchar(4) NOT NULL default '404',
  location varchar(255) default NULL,
  who_req varchar(8) default NULL,
  who_res varchar(8) default NULL,
  PRIMARY KEY  (path,call_num)
) ENGINE=MyISAM;

--
-- Dumping data for table `call`
--

Hope that helps.

B.Kaatz
  • 141
  • 7