0

I am trying to create tables using phpmyadmin but i can't define a column as a foreign Key Constraint as we easily do with an sql query. I tried SQLYog Browser as well. Even I couldn't find it there.. Is there a way that i can define a foreign key in sql browser like phpmyadmin.

2
  • Do you get an error when trying to add one or do you just not know how? To add foreign keys you need to click "Relation View" on the structure of a table and use the drop downs to select the foreign keys making sure you have the correct indexes set and that the table structures match
    – Alex
    Oct 10, 2011 at 14:06
  • in the table structure their is link beneath the structure of the table says Relation View did you tried that
    – Punit
    Oct 10, 2011 at 14:22

3 Answers 3

4

Select the table you need, browse Structure tab. You should be able to see "Relation view" link below the fields.

I would also recommend using Chive - another database management tool - fresh, much more convenient and even more powerful then phpMyAdmin.

1
  • Bear in mind that this link "Relation view" only appears on supported table types such as InnoDB. The link is not present if the table is MyISAM for example. Oct 10, 2011 at 14:20
1

Is this something you could still do manually via the query running functionality in phpmyadmin? I know there is a place to run hand typed, manual queries.

1
  • ya i can do that but i want to do it in an sql browser like Phpmyadmin
    – user769394
    Oct 10, 2011 at 14:20
0

You can benefit from Database Designer tool in dbForge Studio for MySQL. Also, you can create foreign keys in visual object editors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.