Solved

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

Posted on 2006-07-14
5
6,651 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 143

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 143

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

623 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