ERROR 1148: The used command is not allowed with this MySQL version

后端 未结 12 1274
感动是毒
感动是毒 2020-11-27 03:46

I am trying to load data into mysql database using

LOAD DATA LOCAL
INFILE A.txt
INTO DB
LINES TERMINATED BY \'|\';

the topic of this questi

12条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 04:49

    The top answers are correct. Please check them direct in MySQL CLI first. If this fixes the problem there, you may want to have it working in Python3 just pass it to the MySQLdb.connectas parameter

    self.connection = MySQLdb.connect(
                        host=host, user=settings_DB.db_config['USER'],
                        port=port, passwd=settings_DB.db_config['PASSWORD'], 
                        db=settings_DB.db_config['NAME'],
                        local_infile=True)
    

提交回复
热议问题