Guldasta (A bouquet of flowers)

… because life is about varied experiences

  • Subscribe

  • Blog Stats

    • 37,935 hits
  • Disclaimer

    All which I express here are my independent views/opinions and are not necessarily influenced by any organization I work/correspond with.

Archive for July, 2008

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).

  1. Select any table and go to operations tab, if InnoDB is listed under storage engine drop down menu then jump to step 5.
  2. 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).
  3. Add a line in the above file, default_storage_engine=InnoDB (This makes InnoDB the default storage engine).
  4. Restart mysql from the xampp control panel or from MS services.
  5. Make sure, both PARENT and CHILD tables are of storage type InnoDB.
  6. REFERENCED key (in parent) should be primary and REFERENCING key (in child) should be index.
  7. In the CHILD table’s structure view, click on the link ‘relations view’ (it lies above ‘add fields’).
  8. In the row corresponding to the REFERENCING key, select the REFERENCED key from the second column drop box.
  9. Click go .. you’ll see that the required query is executed.
  10. For storage type information go here.


Posted in IT | Tagged: | 28 Comments »