python版本 mysql_使用Python时,此MySQL版本不允许使用used命令

当我在mac上运行这个程序时,我收到了以下错误消息。它在原始Linux计算机上运行良好:File "setupPpiDb.py", line 406, in modules

createDataBase(pdbsToAnalyzeWithChains)

File "setupPpiDb.py", line 202, in createDataBase

''' %(os.path.join(RESULTS_DIR, 'PerAtomDistance.csv')))

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/MySQLdb/cursors.py", line 250, in execute

self.errorhandler(self, exc, value)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler

raise errorvalue

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/MySQLdb/cursors.py", line 247, in execute

res = self._query(query)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/MySQLdb/cursors.py", line 412, in _query

rowcount = self._do_query(q)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/MySQLdb/cursors.py", line 375, in _do_query

db.query(q)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/MySQLdb/connections.py", line 276, in query

_mysql.connection.query(self, query)

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

我在mac上运行Python3并下载了最新的社区下载版本MySQL数据库。完整命令如下:

^{pr2}$

我读到有人发布了本地填充命令。但是,第二行命令有问题,我用local_infile=1连接到数据库:

在MySQLdb.connect(host='localhost',user=user,passwd=passwd,db=db_NAME,local_infile=1)

有什么办法解决这个问题吗?在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值