Forum Moderators: open

Message Too Old, No Replies

SQL Syntax Errors - Trying to import MYSQL DB

         

webzila

5:32 am on Jun 23, 2007 (gmt 0)

10+ Year Member



I am moving my website from one server to another.
I went to my existing server and exported one of my SQL databases using PhpMyAdmin. I then went to the new host and tried to run the query to import the database file.

The process errors out while trying to parse the very first table. It keeps saying:
#1064 - 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 '"frmadmin_logs" (
"id" bigint(20) NOT NULL,
"act" varchar

The query is:

CREATE TABLE "frmadmin_logs"(
"id"bigint( 20 ) NOT NULL ,
"act"varchar( 255 ) default NULL ,
"code"varchar( 255 ) default NULL ,
"member_id"int( 10 ) default NULL ,
"ctime"int( 10 ) default NULL ,
"note"text,
"ip_address"varchar( 255 ) default NULL ,
PRIMARY KEY ( "id" )
) AUTO_INCREMENT =1136

I was able to import this into my original server but keep getting the error above on the new server.

Can anyone tell me why and how to fix this?

Thanks

RonPK

5:32 pm on Jun 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just a hunch: table and column names are usually enclosed in backticks (`). Maybe double quotes cause problems on the new server.

webzila

6:30 pm on Jun 26, 2007 (gmt 0)

10+ Year Member



I resolved the issue by going back to the original database and exporting it again but this time selecting MYSQL40 in the Compatability Mode drop down box first.

RonPK

10:57 am on Jun 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I guess you were upgrading to 5.0 or 5.1. For the record: here's the related info in the manual [dev.mysql.com] (
ANSI_QUOTES
).