pytho使用mysql链接问题

运行如下代码:

 import MySQLdb

conn = MySQLdb.connect(host='localhost',user='root',passwd='123456')

curs = conn.cursor()

conn.select_db('mytest_db')

curs.execute("create table test(id int,message varchar(50))")

value = [1,"davehe"]
curs.execute("insert into test values(%s,%s)",value)

curs.execute("select * from test")
#values = []

conn.commit()

curs.close()

conn.close()

有如下错误:

  • Traceback (most recent call last): File "python_mysql.py", line 3, in conn = MySQLdb.connect(host='localhost',user='root',passwd='123456') File "/usr/local/lib/python3.4/dist-packages/MySQL_python-1.2.5-py3.4-linux-x86_64.egg/MySQLdb/__init__.py", line 80, in Connect from MySQLdb.connections import Connection File "/usr/local/lib/python3.4/dist-packages/MySQL_python-1.2.5-py3.4-linux-x86_64.egg/MySQLdb/connections.py", line 36 raise errorclass, errorvalue ^ SyntaxError: invalid syntax

求大神指导啊。我用的是python3.4

line 36 raise errorclass, errorvalue ^ SyntaxError: invalid syntax
这句话的意思就是36行“语法错误:不正确的语法”。