News:

Wondering if this will always be free?  See why free is better.

Main Menu

SQL syntax error

Started by touficjohn, November 09, 2005, 07:42:12 PM

Previous topic - Next topic

touficjohn

Ok my knowledge of SQL is litterally like 0...

Basically Im moving my forums from one server to another, i made a backup of all the html files no prob, but when it came to restoring the dump file, thru phpmyadmin:
SQL, browse upload wait and it should just bloody work.
No.....

PhPMyAdmin returns this for some reason and i cant figure it out for the life of me!

Error

SQL query:

CREATE TABLE `smf_attachments` (
`ID_ATTACH` int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
`ID_MSG` int( 10 ) unsigned NOT NULL default '0',
`ID_MEMBER` int( 10 ) unsigned NOT NULL default '0',
`filename` tinytext NOT NULL ,
`size` int( 10 ) unsigned NOT NULL default '0',
`downloads` mediumint( 8 ) unsigned NOT NULL default '0',
PRIMARY KEY ( `ID_ATTACH` ) ,
UNIQUE KEY `ID_MEMBER` ( `ID_MEMBER` , `ID_ATTACH` ) ,
KEY `ID_MSG` ( `ID_MSG` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1

MySQL said: Documentation
#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 'DEFAULT CHARSET=latin1' at line 11
[ Back ]

Compuart

It might be a version incompatibility (that is: the version from which you dumped the tables is higher than the version of MySQL you're trying to restore the tables to). Remove the 'DEFAULT CHARSET = latin1' part of your SQL queries and it should work.
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

touficjohn

The old MySQL IS actually a higher version!
I removed all the latin charset queries and now the error returned has turned into a MONSTER error!

Error
There is a chance that you may have found a bug in the SQL parser. Please examine your query closely, and check that the quotes are correct and not mis-matched. Other possible failure causes may be that you are uploading a file with binary outside of a quoted text area. You can also try your query on the MySQL command line interface. The MySQL server error output below, if there is any, may also help you in diagnosing the problem. If you still have problems or if the parser fails where the command line interface succeeds, please reduce your SQL query input to the single query that causes problems, and submit a bug report with the data chunk in the CUT section below:
----BEGIN CUT----
eNqdUMFqwkAQPXe/YgqeJLvuronoQsEQgwqrSbOphV5CbFJMiUmajWK/zUM/qb/QjZdeeurwBh6P
N/OG8aMoiAR4DDwO0t8KYMCBc45UbPQrQt5OCRisMwH6o2zSVuctKYs9aQ6NdQZOxhPglDojOjUw
VHAuGIMyP87AvzQwQJtP9SgF2IQS7mDdpVWWthl6UhEEygJ36W9jC3a+yXsuKtgEL2spXXAIReHG
FSZjQmzclByFq7D3WYHq142JyZFFdbog6W6XAvIKF7rG06kzwwzdQr+vXxjD7QLITscGGCUzhLEB
rGrdCSjr17Q8GAqmFmmX7lOdC+jeE318Y70P/6v6SZW357wF07qoqzubMMLGvx9Ao+G9TRlloPwY
5oFcJN7KjVwv9qPESIkn1+Y3D/P5XzIMRz+KAXSG
----END CUT----
----BEGIN RAW----

ERROR: C1 C2 LEN: 1 2 222
STR: »

CVS: $Id: sqlparser.lib.php,v 2.36 2005/08/08 20:22:11 lem9 Exp $
MySQL: 4.0.25-standard
USR OS, AGENT, VER: Win MOZILLA 5.0
PMA: 2.6.4-pl2
PHP VER,OS: 4.3.11 Linux
LANG: en-iso-8859-1
SQL: -- MySQL dump 10.9
--
-- Host: localhost    Database: tj_smf1
-- ------------------------------------------------------
-- Server version 4.1.13-standard

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */

----END RAW----

SQL query:

-- MySQL dump 10.9 -- -- Host: localhost Database: tj_smf1 -- ------------------------------------------------------ -- Server version 4.1.13-standard /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */

MySQL said: Documentation
#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 '-- MySQL dump 10.9
--
-- Host: localhost    Database: tj_smf

Compuart

I have no clue what that all means. Are all queries terminated by a semicolon (;)?

It might be better to copy-paste blocks of queries seperately to narrow down the origin of the error.
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

Advertisement: