Using MySQL I cannot import a file using load data local infile. My server is on AWS RDS. This works on Ubuntu 10.04. I installed the client using apt-get install mysql-client. Same error if I use mysqldb or mysql.connector in Python.
File "/usr/lib/pymodules/python2.7/mysql/connector/protocol.py", line 479, in cmd_query
return self.handle_cmd_result(self.conn.recv())
File "/usr/lib/pymodules/python2.7/mysql/connector/connection.py", line 179, in recv_plain
errors.raise_error(buf)
File "/usr/lib/pymodules/python2.7/mysql/connector/errors.py", line 82, in raise_error
raise get_mysql_exception(errno,errmsg)
mysql.connector.errors.NotSupportedError: 1148: The used command is not allowed with this MySQL version
I have a lot of data to upload… I can’t believe 12.04 is not supported and I have to use 12.04.
Not really a python question… but the long and short of the matter is that mysql, as compiled and distributed by Ubuntu > 12.04, does not support using
load data local infiledirectly from the mysql client as is.If you search the MySQL Reference Documentation for Error 1148, further down the page linked above, in the comments:
… which does work.
I generally don’t need to load data via code, so that suffices for my needs. If you do, and have the ability/permissions to edit your mysql config file, then the
local-infile=1line in the appropriate section(s) may be simpler.