MySQL: How to set the Primary Key on phpMyAdmin?

前端 未结 4 1277
迷失自我
迷失自我 2021-02-07 04:50

Help! First time using phpMyAdmin. The column that I intend to set as a primary key is of TEXT in phpMyAdmin, it gave me an error message, the primary key can\'t be set! And I d

4条回答
  •  长发绾君心
    2021-02-07 05:31

    You can set a primary key on a text column. In phpMyAdmin, display the Structure of your table, click on Indexes, then ask to create the index on one column. Then choose PRIMARY, pick your TEXT column, but you have to put a length big enough so that its unique.

提交回复
热议问题