Foreign Key in phpMyAdmin (Xampp)
Posted by imdad on July 24, 2008
The following steps are required for you to be able to add foreign keys using phpadmin (in xampp).
- Select any table and go to operations tab, if InnoDB is listed under storage engine drop down menu then jump to step 5.
- So InnoDB is disabled in mysql engine, edit the \xampp\mysql\bi\my.cnf file and remove the hashes that are required to enable InnoDB (its self explanatory).
- Add a line in the above file, default_storage_engine=InnoDB (This makes InnoDB the default storage engine).
- Restart mysql from the xampp control panel or from MS services.
- Make sure, both PARENT and CHILD tables are of storage type InnoDB.
- REFERENCED key (in parent) should be primary and REFERENCING key (in child) should be index.
- In the CHILD table’s structure view, click on the link ‘relations view’ (it lies above ‘add fields’).
- In the row corresponding to the REFERENCING key, select the REFERENCED key from the second column drop box.
- Click go .. you’ll see that the required query is executed.
For storage type information go here.
Nithin said
That was useful, thanks:)
ammu said
i would be better if it was explained with an example
imdad said
thanks for u comments
@ammu .. i agree .. i will try to put in some for other help stuffs in future
storm said
Just what I needed. Thanks!
THANKS said
great instuctions. Thanks!
Brian said
Thank you very much!
Will said
Awesome. Exactly what I needed to know.
Thank you!
titanbullet said
terima kasih saudara
snowflake said
Thank you so so much…i ve been searching for that for a while…
Adam said
Fantastic just want I wanted!
Kevin Korb said
Thanks!
Learned something new.
cagdas said
beautiful article
thanks!
kslacker said
Thanks for this. It was exactly what I needed.
Note: The general steps work on linux based databases as well.
Surendra said
Thanks… cool stuff..
Foreign Key in phpMyAdmin (Xampp) « SoftView2010's Blog said
[...] suryapasupathi PhpMyAdmin PhpMyAdmin Leave a comment Foreign Key in phpMyAdmin (Xampp) [...]
Andy said
Very useful and worked perfect for me in phpmyadmin 3.2.4
samar nabil said
Thanks alot .. it really helped me
Sadhbh said
That helped me out a lot – thanks a million!
Anony Mouse said
Shit don’t work for me. Something about check data type
Speel Tyd said
How do you delete the foreign key?
srikanta said
thanks dude
edith said
tried changing mine but the mysql service wont start again
swellendam accommodation said
swellendam accommodation…
[...]Foreign Key in phpMyAdmin (Xampp) « Guldasta (A bouquet of flowers)[...]…
news source said
outlook festival 2011 moat stage…
[...]Foreign Key in phpMyAdmin (Xampp) « Guldasta (A bouquet of flowers)[...]…
Prestashop Themes said
Prestashop Themes…
[...]Foreign Key in phpMyAdmin (Xampp) « Guldasta (A bouquet of flowers)[...]…
Spawnthing said
snapshots perhaps?
nevertheless good tutorial. Thanks