Solved

What's wrong with my query?

Posted on 2013-05-28
4
286 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Foreword This article was written many years ago, in the days when PHP supported the MySQL extension (http://php.net/manual/en/function.mysql-connect.php).  Today (http://php.net/manual/en/migration70.removed-exts-sapis.php) you would not use MySQL…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

734 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