故障描述
當(dāng)你在使用phpMyAdmin 創(chuàng)建數(shù)據(jù)庫(kù)表的時(shí)候,一般我們需要設(shè)置一個(gè)主鍵,然后讓其自增長(zhǎng),但是有時(shí)候當(dāng)你設(shè)置完成后,你可能會(huì)發(fā)現(xiàn)這樣的錯(cuò)誤:
1089 - Incorrect prefix key; the used key part isn’t a string, the
used length is longer than the key part, or the storage engine doesn’t
support unique prefix keys
圖片顯示如圖所示:
當(dāng)你在使用phpMyAdmin 創(chuàng)建數(shù)據(jù)庫(kù)表的時(shí)候,一般我們需要設(shè)置一個(gè)主鍵,然后讓其自增長(zhǎng),但是有時(shí)候當(dāng)你設(shè)置完成后,你可能會(huì)發(fā)現(xiàn)這樣的錯(cuò)誤:
1089 - Incorrect prefix key; the used key part isn’t a string, the
used length is longer than the key part, or the storage engine doesn’t
support unique prefix keys
圖片顯示如圖所示:
故障分析:
我們發(fā)現(xiàn)了PRIMARY KEY 那里確實(shí)多了一個(gè)4
那么問(wèn)題如何解決呢?
難道真的要命令行去處理?當(dāng)然不。
解決方案:
當(dāng)設(shè)置自增長(zhǎng)的時(shí)候,我們都會(huì)看到這個(gè)界面:
Tips:
值得注意的是,這個(gè)大小并不是必須值,但是對(duì)phpMyAdmin不是很熟的,第一次見(jiàn)到很容易潛意識(shí)給設(shè)置一個(gè)值,一旦設(shè)置了就會(huì)出現(xiàn)上述的錯(cuò)誤。
所以最終的解決方案就是圖中的大小這里我們只要保留空白,點(diǎn)擊執(zhí)行,然后就可以保存表成功。