python 准备好的 stmt 参数传递问题

Problem with python prepared stmt parameter passing

文件 C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\mysql\connector\cursor.py,第 1149 行,在执行 elif len(self._prepared[parameters]) != len(params): TypeError: object of type int has no len( )

问题是python当我们传递单个参数时出错,我们需要输入逗号(,) 在第一个参数的末尾。喜欢下面的

input=(customerId,)
cursor.execute(sql, input)