How to import mysql innodb with foreign key constraint error?
- font size decrease font size increase font size
- Print Email
To import mysql innodb with foreign key constraint error, follow the steps below:-
- If you have the access to mysql thru terminal, then you can use the command below:-
mysql> SET foreign_key_checks = 0; mysql> SOURCE your_db_dump_file; mysql> SET foreign_key_checks = 1;
- If you import your database thru web interface like phpmyadmin, then you need to edit the sql dump file. Add this to the 1st line of your sql db dump file:-
SET foreign_key_checks = 0;
- then add this line to the last line in your sql db dump file:-
SET foreign_key_checks = 1;
- Now you may import your sql dump file, and it should have no error by now.
Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478
back to top