How to make composite primary key on phpmyadmin

If the table is already created:

  1. From the “Structure” pane, check the boxes to the left of all field names you want included in the primary key. (For example, in an order items table, you might check “order ID” and “line item number”.)
  2. Then click “Primary” in the “With selected:” list of operations just below the field names.

enter image description here

You can now also define the keys while creating the table as mentioned in @amila’s answer

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)