1ALTER TABLE table_name
2ADD CONSTRAINT fk_foreign_key_name
3FOREIGN KEY (foreign_key_name)
4REFERENCES target_table(target_key_name);
1go to phpmyadmin
2 select a table
3 go to structure
4 select the column you want to make primary
5 click on the primary written beside check all