python 连接mysql 时,connect 出现错误,怎么解决

2024-11-15 17:35:53
推荐回答(2个)
回答1:

# -*- coding: utf-8 -*-import MySQLdbfrom MySQLdb.cursors import DictCursor def catch_2006(func): """ To catch MySQL Error 2006 ('Server has gone away') """ def _(self, *args, **kwargs): try: return func(self, *args, **kwargs) ...

回答2:

有错误就要改正