Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Saving position of jquery sortable portlet to database 11 58
[MYSQL]: Delete is very slow 4 54
MySql hide the stored procedures 2 40
xampp tool 12 30
I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

26 Experts available now in Live!

Get 1:1 Help Now