PDA

View Full Version : Error SQL-query


J.C.
Wed 25th Jun '03, 9:37pm
I'm trying to restore this table using phpmyadmin:

# phpMyAdmin MySQL-Dump
# version 2.4.0
# http://www.phpmyadmin.net/ (download page)
#
# Host: localhost
# Generation Time: Jun 25, 2003 at 08:33 PM
# Server version: 4.0.13
# PHP Version: 4.2.3
# Database : `*********`
# --------------------------------------------------------
#
# Table structure for table `shoutbox_swears`
#
CREATE TABLE shoutbox_swears (
id int(11) NOT NULL auto_increment,
orig varchar(255) NOT NULL default '',
replace varchar(255) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;
#
# Dumping data for table `shoutbox_swears`
#

but got this weird errors (always!):

Error
SQL-query :
CREATE TABLE shoutbox_swears( id int( 11 ) NOT NULL auto_increment,
orig varchar( 255 ) NOT NULL default '',
REPLACE varchar( 255 ) NOT NULL default '',

PRIMARY KEY ( id )
)
TYPE =
MYISAM
MySQL said:

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 'REPLACE varchar( 255 ) NOT NULL default '', PRIMARY KEY (does anyone know how to fix the table and can restore it successfully?thanks, need help asap.

eva2000
Wed 25th Jun '03, 11:14pm
are you restoring a mysqldump to your empty database, from the same version as the dump was from ?

also you cut off the ending of the error number as well

J.C.
Wed 25th Jun '03, 11:45pm
No, my website is moving servers and I'm restoring all my vb database's tables to the new server.

I can restore all other tables, except this one.

This is the error message when I restore it (run query) using the 'MySQL Query' feature on vb admin cp:

Database error in vBulletin Control Panel 2.2.9:
Invalid SQL: CREATE TABLE shoutbox_swears (
id int(11) NOT NULL auto_increment,
orig varchar(255) NOT NULL default '',
replace varchar(255) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;
mysql error: 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 'replace varchar(255) NOT NULL default '',
PRIMARY KEY (id)
mysql error number: 1064
Date: Wednesday 25th of June 2003 10:46:24 PM

Steve Machol
Wed 25th Jun '03, 11:50pm
As eva2000 asked, what is the MySQL version on the new server? There may be incompatibilites between a dump made with one version of MySQL and a restore on another version. We've run into this before.

J.C.
Wed 25th Jun '03, 11:54pm
the new server mysql version: MySQL Version4.0.13
the old server mysql version:
MySQL Version4.0.13

It's the same...

eva2000
Thu 26th Jun '03, 12:02am
strange your sql file does have incorrect syntax for creating the table you have 2 instances of quotation mark " where it shouldn't exist


CREATE TABLE shoutbox_swears (
id int(11) NOT NULL auto_increment,
orig varchar(255) NOT NULL default '',
replace varchar(255) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;



should be


CREATE TABLE shoutbox_swears (
id int(11) NOT NULL auto_increment,
orig varchar(255) NOT NULL default,
replace varchar(255) NOT NULL default,
PRIMARY KEY (id)
) TYPE=MyISAM;

J.C.
Thu 26th Jun '03, 12:09am
Still error :( :

Database error in vBulletin Control Panel 2.2.9:
Invalid SQL: CREATE TABLE shoutbox_swears (
id int(11) NOT NULL auto_increment,
orig varchar(255) NOT NULL default,
replace varchar(255) NOT NULL default,
PRIMARY KEY (id)
) TYPE=MyISAM;
mysql error: 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 '
replace varchar(255) NOT NULL default,
PRIMARY KEY (id)
) T
mysql error number: 1064
Date: Wednesday 25th of June 2003 11:13:27 PM