SQL: set existing column as Primary Key in MySQL

前端 未结 5 916
北恋
北恋 2021-01-31 13:23

I have a database with 3 columns:

id, name, somethingelse  

This table has no index set and i am getting \"No index defined!\" in phpmyadmin

5条回答
  •  北恋
    北恋 (楼主)
    2021-01-31 14:02

    Either run in SQL:

    ALTER TABLE tableName
      ADD PRIMARY KEY (id)           ---or Drugid, whichever you want it to be PK
    

    or use the PHPMyAdmin interface (Table Structure)

提交回复
热议问题