重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

pymysql.err.InternalError:107

pyMySQL.err.InternalError: (1075, 'Incorrect table definition; there can be only one auto column and it must be defined as a key')

pymysql.err.InternalError: 107
python中使用pymysql创建table是报错是上面标题,sql语句如下:
sql = '''
create table music (
id int not null auto_increment,
song text,
singer text,
genre text,
issue text,
publisher text,
score text)'''
百度,问题是:自增字段必须是主键。解决办法是设置id为主键。
修改后sql为:
sql = '''
create table music (
id int not null auto_increment,
song text,
singer text,
genre text,
issue text,
publisher text,
score text,
primary key(id)
)'''
感谢:https://www.cnblogs.com/guodongdidi/p/6290782.html

创新互联是一家专注于网站制作、成都网站建设与策划设计,思茅网站建设哪家好?创新互联做网站,专注于网站建设十载,网设计领域的专业建站公司;建站业务涵盖:思茅等地区。思茅做网站价格咨询:18980820575


标题名称:pymysql.err.InternalError:107
本文链接:http://cqcxhl.com/article/gsipdi.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP