-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Pymysql fail to use LOAD DATA LOCAL INFILE #407
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
Which version of PyMySQL do you use? Since PyMySQL doesn't use libmysqlclient, PyMySQL's my.cnf support is very limited. |
Thanks @methane for this quick answer. So I have done a check on my database to display if local_infile variable is activated
As you can see the variable is set to I finally discover how to do it : engine = create_engine('mysql+pymysql://user:user@localhost/DB?local_infile=1') Adding I tried to set the variable
But that do not fix the problem, I tried to do it programmatically: engine = create_engine('mysql+pymysql://user:user@localhost/DB?local_infile=1&max_allowed_packet=16777216') Same here that don't works as expected while the file is not bigger as 1Gb Thanks for your helps |
Syntax Error means your SQL may be broken. |
I'm also experiencing errors when I try to LOAD DATA LOCAL INFILE. I get a:
I have read in other issues created that PyMYSQL is not thread safe however my connection is not shared and is running in a completely separate Python Process where I initiate the connection and then try to LOAD the data. Should I create a separate issue? |
@aldeirm2 Yes, please. |
I created a issue with some sample code. Thanks |
Dear,
I would like to use pymysql with sqlachemy (python3) to load a local file. Thus I execute this statement:
But an error is raised:
I tried with another engine mysqldb instead of pymysql and works as expected.
Any help are welcome
The text was updated successfully, but these errors were encountered: