首页 > 数据库技术 > 详细

pymysql.err.InternalError: 1075

时间:2019-09-18 12:30:25      阅读:115      评论:0      收藏:0      [点我收藏+]
pymysql.err.InternalError: (1075, ‘Incorrect table definition; there can be only one auto column and it must be defined as a key‘)

技术分享图片
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

pymysql.err.InternalError: 1075

原文:https://blog.51cto.com/11575772/2438822

(1)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!