-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Error when trying to execute "LOAD DATA LOCAL INFILE" using Python Processes #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If it's true, muti-process must not affect. |
Your first exception is |
Mhh I'm getting the exact same error from a single process. If I run the exact same statement/code from the mysql connector it works without any problems so I don't know how it can be a server side issue. There are also nothing to note in the server logs. Any ideas? |
Could you post error log from single process? |
Do you use |
Here is the log from the single process:
The only thing I can see in the logs is the query:
I tried setting the log-warnnings to the highest value but I can't see anything there in the logs |
Which log file did you see?
|
I'm using RDS on AWS, so I checked both the general/mysql-general.log which just has the queries and error/mysql-error.log which is completely empty. |
Have you checked |
Yes, the file csv file is about 50MB and I have As I mentioned it's odd that the exact same load statement on the same database works using other libraries but just fails with pymysql. I did try select, update and insert statements with pymysql though and they all worked, it's just the |
Which |
Very very interesting :o So I had it set to 250MB on the server side (and I still didn't change that) and Why is that? Is there a cap on the |
max_allowed_packet may be bigger than max size of packet.
|
Yes this causes a new error for me. I remember why I set the Setting the |
You can set large |
That's odd. After changing the
|
Yes. setting max_allowed_packet to 16KB breaks your queries larger than 16KB. |
I'm very sleepy since it's 3:30 am in Japan. I hope I have time to make new release in this week. |
You certainly don't need to be apologizing. You're supporting this library during your own time and I'm sure everyone appreciates it. Thank you for your help, very appreciated. |
I have a multiprocess application that processes large volumes of data in parallel and at the end loads CSV files into my DB.
The code starts off by creating n number of Python Processes . In each of these processes, I create a separate connection and cursor which I try to use to load this data however I keep getting an error with:
pymysql.err.InternalError: Packet sequence number wrong - got 3 expected 2
Sample code here but obviously you would need to put in connection details etc:
Of course my actual script/processes do a lot more than just load the data but this should be sufficient to replicate the issue.
I also know that this isn't a problem from the actual DB as I can load files without any problem using the python MySQL connector tool but I don't want to use it as it's buggy.
Full error below:
If you need any further information please let me know.
Python version: 3.4
PyMYSQL version: 0.7.1
OS: MAC
The text was updated successfully, but these errors were encountered: