Solved

What's wrong with my query?

Posted on 2013-05-28
4
287 Views
Last Modified: 2013-07-03
I've attached a large query. For some reason though it seems to fail importing with this error:
#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 'Swiss Roll 300g','2.45'),('Bakery','05/28/2013 13:53:56','Staffords Apple Tart 6' at line 1

I've removed that line and the error continues onto the next line. I can't understand why this is so as the inputs before it don't get flagged as a problem.

It is a large query and Im running it in through phpmyadmin SQL tab. If I reduce down the rows it works fine (tested it at around 300) however, why this error is appearing I do not know.

Thanks in advance.
query.txt
0
Comment
Question by:oconnork00
[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
4 Comments
 
LVL 11

Expert Comment

by:John Easton
ID: 39201267
I'm not a mySQL expert, but it sounds like the number of records you are inserting have exceeded the max query size and therefore mySQL my be truncating your query which would give an error.
0
 
LVL 5

Expert Comment

by:sriramiyer
ID: 39201320
I have changed your query.
Here you try this new file attatched.
pl give feed back for immediate assistance!
from
SriRamIyer
queryNew.txt
0
 
LVL 41

Accepted Solution

by:
ralmada earned 500 total points
ID: 39201624
The limit of your statement is established by the max_allowed_packet parameter. Try adjusting it and re-run your query. For example you can increase it to 32M like this:

mysqld --max_allowed_packet=32M

http://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html

or you can break your query into multiple ones as suggested above
0
 
LVL 5

Expert Comment

by:sriramiyer
ID: 39215363
>> oconnork00
Are you convinced! post your comments pl
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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 …
Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

688 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