Solved

Error Code: 1064 - You have an error in your SQL syntax;

Posted on 2006-07-14
5
6,503 Views
Last Modified: 2011-08-18
Hello Experts,

now...after long time having used MySQL, I still can't understand the following:
I do create a dump file in order to insert that one to a newly created database.
So far so simple.
For this I use phpMyAdmin
When I try to import that file to the new database, always this error returns:

Error Code: 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 '
CREATE TABLE `ANY TABLE` (`ANY TABLE_id` int(11) NOT NULL auto_increme' at line 1

I will never understand how what these guys from phpMyAdmin have been thinking
The same app produces the dump but the same app returns an error while importing. I WILL NEVER UNDERSTAND THIS!

I used any php script to run the import, used navicat and any other software ( like SQLYok...ect) Always the same error.
Import works only if I do this manually running queries (copy/paste)

Now please.....what the ** is this error?
And how finally can I import my dumped files? How do you do this?

I'm running on Windows 2003, MySQL 4.1.12
0
Comment
Question by:sh2gr
  • 2
  • 2
5 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 17109974
>The same app produces the dump but the same app returns an error while importing.
actually, this is wrong. phpmyadm calls the mysqldump command line tool that generates the script!

this error looks like that there is some special character before the CREATE TABLE script...
0
 

Author Comment

by:sh2gr
ID: 17110153
Angel,

we have been trough this in one of my previous post.
I don't want to go deeper in who calls what etc. What does that mean? that phpMyAdmin does whatever it wants?
My opnion on that is, that whoever, whatever genarates the dump....should genarate it in order to be available error free for import.
And however....is there a need to place any special characters in front/behind/above...to make peoples life more difficult?
I mean...you understand what the logical approach should be....and it is not!


This is a part of the dump, even when deleting the -- comments, I get the error



-- --------------------------------------------------------

--
-- Table structure for table `address_book`
--

CREATE TABLE `address_book` (`address_book_id` int(11) NOT NULL auto_increment,
  `customers_id` int(11) NOT NULL default '0',
  `entry_gender` char(1) NOT NULL default '',
  `entry_company` varchar(32) default NULL,
  `entry_tva_intracom` varchar(32) default NULL,
  `entry_firstname` varchar(32) NOT NULL default '',
  `entry_lastname` varchar(32) NOT NULL default '',
  `entry_street_address` varchar(64) NOT NULL default '',
  `entry_suburb` varchar(32) default NULL,
  `entry_postcode` varchar(10) NOT NULL default '',
  `entry_city` varchar(32) NOT NULL default '',
  `entry_state` varchar(32) default NULL,
  `entry_country_id` int(11) NOT NULL default '0',
  `entry_zone_id` int(11) NOT NULL default '0',
  PRIMARY KEY  (`address_book_id`),
  KEY `idx_address_book_customers_id_zen` (`customers_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=36 ;

--
-- Dumping data for table `address_book`
--
0
 
LVL 22

Assisted Solution

by:NovaDenizen
NovaDenizen earned 250 total points
ID: 17111480
The table that causes the error, is it the first table in the dump file?  I think the "'" might be part of a previous INSERT statement with improperly escaped characters.
0
 

Author Comment

by:sh2gr
ID: 17111859
These people (the phpMyAdmin & MySQL Staff) are working hard to release new versions.....
and they never thought about the simpliest detail :
To offer a "split file" for larger data import, for heavy files.
Instead they let people run into support forums, sometimes make things worse.

There was no special character, there is only a special "developers virus" which makes the dev's forget that their developed tool has to be user friendly even for their mom

I split my file in to 4 pieces and all errors disapeared, the import was a 3 minutes job.
And I can not say that it was a big file (7 MB)

Thank you for your efforts....I think it will be wise to split the points
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17115288
Glad you found a solution.

you should not be angry too much on the developers of phpmyadmin, don't forget that they wrote it for FREE !!!
note that you should not use phpmyadmin for large scripts, but rather use the command line tool mysql directly.

I had also many problems with large script with phpmyadmin, no longer using it for large scripts.

angelIII


0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now