错误内容:
pymysql.err.InternalError: Packet sequence number wrong - got 1 expected 0
这个是怎么回事?
这是我的 python 代码:
import pymysql
DB_Host = "10.10.10.47"
DB_Name = "zabbix"
DB_User = "admin"
DB_Password = "P@ssw0rd@"
print("Connecting to database using MySQLdb...")
db = pymysql.Connect(host=DB_Host, db=DB_Name, user=DB_User, passwd=DB_Password,charset='utf8',)
print("Succesfully Connected to database using MySQLdb!")
db.close()
import pymysql
print("Connecting to database using MySQLdb...")
db = pymysql.Connect("10.10.10.47", "zabbix", "admin", "P@ssw0rd@",charset='utf8',)
cur = db.cursor()
lst = []
cur.execute('SELECT * from your table here')
print()
print(cur.description, end = '')
for row in cur.fetchall():
lst = list(row)
print(row, lst)
cur.close()
db.close()
程式碼簡化了一下下試看看?