0

Looking at _mysql documentation, i find:

help(_mysql.connection)
class connection(__builtin__.object)
...
load_infile
  int, non-zero enables LOAD LOCAL INFILE, zero disables

Then, i try to create a connection and i have :

python> _mysql.connection(host = ..., db = ..., user = ..., passwd = ..., load_infile = 1)
TypeError                                 Traceback (most recent call last)
<ipython-input-23-e3878d45fb4e> in <module>()
----> 1 _mysql.connection(host = ..., db = ..., user = ..., passwd = ..., load_infile = 1)
TypeError: 'load_infile' is an invalid keyword argument for this function

What am i missing ?

Fyi:

In [25]: _mysql.version_info
Out[25]: (1, 2, 3, 'final', 0)

In [26]: _mysql.get_client_info()
Out[26]: '6.0.0'

1 Answer 1

1

I assume you are trying this because of the error :

_mysql_exceptions.OperationalError: (1148, 'The used command is not allowed with this MySQL version')

I also struggled with this for hours but finally found a solution : MySQLdb.connect(server, username, password, database, cursorclass = MySQLdb.cursors.DictCursor, local_infile = 1)

I know your question was about _mysql and not MySQLdb, but as per mata's comment you should not use _mysql

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.