溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

pymysql.err.Internal報107錯誤

發(fā)布時間:2020-05-23 17:33:49 來源:網(wǎng)絡(luò) 閱讀:248 作者:三月 欄目:MySQL數(shù)據(jù)庫

下面一起來了解下pymysql.err.Internal報107錯誤,相信大家看完肯定會受益匪淺,文字在精不在多,希望pymysql.err.Internal報107錯誤這篇短內(nèi)容是你想要的。

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

pymysql.err.Internal報107錯誤
python中使用pymysql創(chuàng)建table是報錯是上面標(biāo)題,sql語句如下:
sql = '''
create table music (
id int not null auto_increment,
song text,
singer text,
genre text,
issue text,
publisher text,
score text)'''
百度,問題是:自增字段必須是主鍵。解決辦法是設(shè)置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)
)'''

看完pymysql.err.Internal報107錯誤這篇文章后,很多讀者朋友肯定會想要了解更多的相關(guān)內(nèi)容,如需獲取更多的行業(yè)信息,可以關(guān)注我們的行業(yè)資訊欄目。

向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI