新手学python数据库管理 这是代码 import pymysql db = pymysql.connect('localhost','root','426lijiang','mytable') cursor = db.cursor() #cursor.execute("DROP TALBE IF EXISTS books") sql = """ create table books( id int(8) NOT NULL AUTO_INCREMENT, name varchar(50) NOT NULL, category varchar(50) NOT NULL, price decimal(10,2) DEFAULT NULL, publish_time data DEFAULT NULL, PRIMARY KEY (id) )ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; """ cursor.execute(sql) cursor.close() db.close()
报错:pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'data DEFAULT NULL,\nPRIMARY KEY (id) \n)engine=MyISAM AUTO_INCREMENT=1 DEFAULT CHA' at line 6")
我使用的MySQL是8.0版本,python是3.0版本。
向各位大佬求助