Solved

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

Posted on 2006-07-14
5
6,542 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
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.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

777 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