Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the "Internal Relations" defined in phpMyAdmin?

In the phpMyAdmin relation view, there is a column for "internal relation" right next tor "foreign key constraint". I know what foreign keys are used for in mySQL, but I've never heard of internal relations.

Is this a phpMyAdmin thing?

like image 677
Tyler DeWitt Avatar asked Jan 28 '12 21:01

Tyler DeWitt


People also ask

How does phpMyAdmin determine relations?

Click on a table within your database and choose the Operations tab. Make sure that the storage engine is set to use InnoDB and save your changes. Now, go back to your table view and click the Structure tab. Depending on your version of phpMyAdmin you should see a link titled Relation view below the table structure.

How do I set a foreign key relationship in phpMyAdmin?

Define foreign key in phpMyAdminAfter clicking the 'Relation view' in the 'product_category' table, you can set foreign keys. You will be given a table where each row corresponds to an indexed column in your referring table ('product_category').


1 Answers

This is a phpmyadmin internal mechanism to manage relationship between tables.
This feature is actually useful for MYISAM tables which don't support foreign keys and constraints.
By defining internal relations in phpmyadmin you link tables together which otherwise can't be linked. These information are stored in a phpmyadmin specific table inside your MySQL server (phpmyadmin.PMA_relation).

However this is just a phpmyadmin internal definition and has no effect on mysql itself (no foreign key constraints or referential integrity are enforced).

See here for additional information.

like image 149
Ümit Avatar answered Sep 30 '22 17:09

Ümit