0

i have a Windows 2003 server with MySQL 5.5. I am attempting to import a MySQL dump, however a Syntax error is being generated on the table creates. When I try the same query on my Linux 5.1 installation, there is no problem.

The original data does not exist, so im somewhat stuck now..

CREATE TABLE `articledata` 
(
    `ID` integer (10) UNSIGNED  NOT NULL AUTO_INCREMENT , 
    `templateid` integer (11) NOT NULL DEFAULT 0, 
    `issueid` integer (11) NOT NULL DEFAULT 0, 
    `articletitle` varchar (255) NOT NULL, 
    `articletext` text NOT NULL, 
    `articlepic1` varchar (255) NOT NULL, 
    `articlepriority` integer (11) NOT NULL DEFAULT 0, 
    `articledetails` text NOT NULL, 
    `articledetailstitle2` varchar (255) NOT NULL, 
    `articledetails2` text NOT NULL, 
    `articlepic2` varchar (255) NOT NULL, 
    `articledetailstitle` varchar (255) NOT NULL, 
    `articlepic1a` varchar (255) NOT NULL, 
    `subclusterid` integer (11) NOT NULL,
    PRIMARY KEY (`ID`)
) TYPE=InnoDB CHARACTER SET latin1 COLLATE latin1_swedish_ci;

Error is

ERROR 1064 <42000>: You have an error in your SQL syntax near: TYPE=InnoDB CHARACTER SET latin1 COLLATE latin1_swedish_ci;
1
  • And the error you're getting is...? Commented Jan 18, 2012 at 18:09

2 Answers 2

3

Should be:

# Notice Type should be Engine
)ENGINE=InnoDB DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
Sign up to request clarification or add additional context in comments.

Comments

0

The dump you are importing mostlikely comes from a different database which had a different setup. The character set specified I would assume is not valid is your current instance of mysql I would double check with this link:

http://dev.mysql.com/doc/refman/5.5/en/charset-server.html

You can try to remove the last part to become

CREATE TABLE `articledata` 
(
    `ID` integer (10) UNSIGNED  NOT NULL AUTO_INCREMENT , 
    `templateid` integer (11) NOT NULL DEFAULT 0, 
    `issueid` integer (11) NOT NULL DEFAULT 0, 
    `articletitle` varchar (255) NOT NULL, 
    `articletext` text NOT NULL, 
    `articlepic1` varchar (255) NOT NULL, 
    `articlepriority` integer (11) NOT NULL DEFAULT 0, 
    `articledetails` text NOT NULL, 
    `articledetailstitle2` varchar (255) NOT NULL, 
    `articledetails2` text NOT NULL, 
    `articlepic2` varchar (255) NOT NULL, 
    `articledetailstitle` varchar (255) NOT NULL, 
    `articlepic1a` varchar (255) NOT NULL, 
    `subclusterid` integer (11) NOT NULL,
    PRIMARY KEY (`ID`)
);

Which works fine here so it really is a character set configuration issue from your server.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.