Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

What's wrong with my query?

Posted on 2013-05-28
4
Medium Priority
?
289 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 2000 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

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 …
Creating and Managing Databases with phpMyAdmin in cPanel.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

604 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