{"id":440,"date":"2013-08-14T13:23:18","date_gmt":"2013-08-14T13:23:18","guid":{"rendered":"https:\/\/shan.info\/new\/how-to-import-mysql-innodb-with-foreign-key-constraint-error\/"},"modified":"2013-08-14T13:23:18","modified_gmt":"2013-08-14T13:23:18","slug":"how-to-import-mysql-innodb-with-foreign-key-constraint-error","status":"publish","type":"post","link":"https:\/\/shan.info\/new\/how-to-import-mysql-innodb-with-foreign-key-constraint-error\/","title":{"rendered":"How to import mysql innodb with foreign key constraint error?"},"content":{"rendered":"<h3 style=\"font-family: Georgia, 'Times New Roman'; font-weight: normal; font-size: 18px; margin-top: 30px; color: #222222; line-height: 25px; text-align: justify;\">To import mysql innodb with foreign key constraint error, follow the steps below:-<\/h3>\n<ul style=\"padding-left: 10px; text-indent: -10px; color: #333333; font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 12px; line-height: 25px; text-align: justify;\">\n<li style=\"margin: 7px 0px 8px 10px;\">If you have the access to mysql thru terminal, then you can use the command below:-\n<pre style=\"width: 550px; padding: 10px 10px 10px 20px; background-color: #222222; overflow: auto; font-size: 12px; color: #ffffff; font-family: 'Bitstream Vera Sans Mono', monospace;\">mysql&gt; SET foreign_key_checks = 0;\r\nmysql&gt; SOURCE your_db_dump_file;\r\nmysql&gt; SET foreign_key_checks = 1;\r\n<\/pre>\n<\/li>\n<li style=\"margin: 7px 0px 8px 10px;\">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:-\n<pre style=\"width: 550px; padding: 10px 10px 10px 20px; background-color: #222222; overflow: auto; font-size: 12px; color: #ffffff; font-family: 'Bitstream Vera Sans Mono', monospace;\">SET foreign_key_checks = 0;<\/pre>\n<\/li>\n<li style=\"margin: 7px 0px 8px 10px;\">then add this line to the last line in your sql db dump file:-\n<pre style=\"width: 550px; padding: 10px 10px 10px 20px; background-color: #222222; overflow: auto; font-size: 12px; color: #ffffff; font-family: 'Bitstream Vera Sans Mono', monospace;\">SET foreign_key_checks = 1;<\/pre>\n<\/li>\n<li style=\"margin: 7px 0px 8px 10px;\">Now you may import your sql dump file, and it should have no error by now.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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&gt; SET foreign_key_checks = 0; mysql&gt; SOURCE your_db_dump_file; mysql&gt; SET foreign_key_checks = 1; If you import your database thru web interface like phpmyadmin, then you need [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[],"class_list":["post-440","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/comments?post=440"}],"version-history":[{"count":0,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/440\/revisions"}],"wp:attachment":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/media?parent=440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/categories?post=440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/tags?post=440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}