python连接MySQL报错InterfaceError: (-1, 'error totally whack')

iFe-Ather 发布于 2016/10/24 11:46
阅读 2K+
收藏 0

在linux下使用Python对MySQL操作报错

百度上搜不出来如何解决

报错信息如下:

>>> curs.execute("""create table a(b int)""")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.InterfaceError: (-1, 'error totally whack')
>>> cur.execute("create table student(id int ,name varchar(20),class varchar(30),age varchar(10))")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'cur' is not defined
>>> curs.execute("create table student(id int ,name varchar(20),class varchar(30),age varchar(10))")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.InterfaceError: (-1, 'error totally whack')



求问怎么解决

加载中
返回顶部
顶部