Solved

What's wrong with my query?

Posted on 2013-05-28
4
281 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
  • 2
4 Comments
 
LVL 10

Expert Comment

by:JEaston
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

21 Experts available now in Live!

Get 1:1 Help Now