Disabling foreign key checks on the command line





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







44















I have a backup script for my MySQL database, using mysqldump with the --tab option so it produces a .sql file for the structure and a .txt file (pipe-separated) for the content.



Some tables have foreign keys, so when I import it I'm getting the error:




ERROR 1217 (23000) at line 8: Cannot delete or update a parent row: a foreign key constraint fails




I know about using SET FOREIGN_KEY_CHECKS=0 (and SET FOREIGN_KEY_CHECKS=1 afterward). If I add those to each .sql file then the import works. But then obviously on the next mysqldump those get overwritten.



I also tried running it as a separate command, like below but the error comes back:



echo "SET FOREIGN_KEY_CHECKS=0" | mysql [user/pass/database] 
[all the imports]
echo "SET FOREIGN_KEY_CHECKS=1" | mysql [user/pass/database]


Is there some other way to disable FK checks on the command line?










share|improve this question





























    44















    I have a backup script for my MySQL database, using mysqldump with the --tab option so it produces a .sql file for the structure and a .txt file (pipe-separated) for the content.



    Some tables have foreign keys, so when I import it I'm getting the error:




    ERROR 1217 (23000) at line 8: Cannot delete or update a parent row: a foreign key constraint fails




    I know about using SET FOREIGN_KEY_CHECKS=0 (and SET FOREIGN_KEY_CHECKS=1 afterward). If I add those to each .sql file then the import works. But then obviously on the next mysqldump those get overwritten.



    I also tried running it as a separate command, like below but the error comes back:



    echo "SET FOREIGN_KEY_CHECKS=0" | mysql [user/pass/database] 
    [all the imports]
    echo "SET FOREIGN_KEY_CHECKS=1" | mysql [user/pass/database]


    Is there some other way to disable FK checks on the command line?










    share|improve this question

























      44












      44








      44


      14






      I have a backup script for my MySQL database, using mysqldump with the --tab option so it produces a .sql file for the structure and a .txt file (pipe-separated) for the content.



      Some tables have foreign keys, so when I import it I'm getting the error:




      ERROR 1217 (23000) at line 8: Cannot delete or update a parent row: a foreign key constraint fails




      I know about using SET FOREIGN_KEY_CHECKS=0 (and SET FOREIGN_KEY_CHECKS=1 afterward). If I add those to each .sql file then the import works. But then obviously on the next mysqldump those get overwritten.



      I also tried running it as a separate command, like below but the error comes back:



      echo "SET FOREIGN_KEY_CHECKS=0" | mysql [user/pass/database] 
      [all the imports]
      echo "SET FOREIGN_KEY_CHECKS=1" | mysql [user/pass/database]


      Is there some other way to disable FK checks on the command line?










      share|improve this question














      I have a backup script for my MySQL database, using mysqldump with the --tab option so it produces a .sql file for the structure and a .txt file (pipe-separated) for the content.



      Some tables have foreign keys, so when I import it I'm getting the error:




      ERROR 1217 (23000) at line 8: Cannot delete or update a parent row: a foreign key constraint fails




      I know about using SET FOREIGN_KEY_CHECKS=0 (and SET FOREIGN_KEY_CHECKS=1 afterward). If I add those to each .sql file then the import works. But then obviously on the next mysqldump those get overwritten.



      I also tried running it as a separate command, like below but the error comes back:



      echo "SET FOREIGN_KEY_CHECKS=0" | mysql [user/pass/database] 
      [all the imports]
      echo "SET FOREIGN_KEY_CHECKS=1" | mysql [user/pass/database]


      Is there some other way to disable FK checks on the command line?







      mysql command-line foreign-keys mysqlimport






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 11 '13 at 0:20









      DisgruntledGoatDisgruntledGoat

      41.5k56178264




      41.5k56178264
























          4 Answers
          4






          active

          oldest

          votes


















          66














          You can do this by concatenating the string to the file inline. I'm sure there's an easier way to concatenate strings and files, but it works.



          cat <(echo "SET FOREIGN_KEY_CHECKS=0;") imports.sql | mysql


          I don't think you need to set it back to 1 since it's just one session.






          share|improve this answer
























          • This looks like the best way. It's surprising mysqldump doesn't have a --disable-foreign-keys option.

            – Barmar
            Apr 11 '13 at 0:53






          • 3





            @Barmar remember that foreign keys are a product of the InnoDB engine rather than MySQL itself

            – Explosion Pills
            Apr 11 '13 at 1:01











          • Thanks, that is working! So setting FK checks only works for one command, rather than persisting across multiple commands?

            – DisgruntledGoat
            Apr 11 '13 at 16:25








          • 2





            @ExplosionPills @Barmar just ran into another issue, how would I disable FK checks on the actual data import? My table has an FK to itself that may reference a later ID. My import command is mysqlimport [user/pass] --local --fields-terminated-by="|" database "table.txt"

            – DisgruntledGoat
            Apr 18 '13 at 23:14






          • 1





            Anybody know how to do this in Windows? :/

            – Charles Wood
            Nov 5 '13 at 18:15



















          77














          You can also use --init-command parameter of mysql command.



          I.e.: mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" ...



          MySQL 5.5 Documentation - mysql options






          share|improve this answer





















          • 5





            This is the best solution, better than the answer of "Explosion Pills"

            – chris342423
            Sep 14 '16 at 9:45











          • i tried like : mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBname and i get You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBName' at line 1

            – Sushivam
            Nov 17 '16 at 6:38



















          14














          Just another one to do the same:



          { echo "SET FOREIGN_KEY_CHECKS=0;" ; cat imports.sql ; } | mysql





          share|improve this answer





















          • 1





            Thanks, this was perfect since I was zcating my other file.

            – Aaron R.
            Feb 24 '17 at 18:33



















          4














          Login to mysql command line:



          mysql -u <username> -p -h <host_name or ip> Then run



          1 SET FOREIGN_KEY_CHECKS=0;



          2 SOURCE /pathToFile/backup.sql;



          3 SET FOREIGN_KEY_CHECKS=1;



          Do not try to run directly from MySQL command line.






          share|improve this answer


























          • I'm confused. Don't your instructions imply that you should be running this directly from the MySQL command line?

            – Jeremy Dennen
            Apr 10 at 20:44











          • @JeremyDennen Yes, run it from mysql command line.

            – deepak
            Apr 11 at 7:16











          • You may want to update your answer to clarify that then. Currently it says do not run directly from MySQL command line

            – Jeremy Dennen
            10 hours ago












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f15938786%2fdisabling-foreign-key-checks-on-the-command-line%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          4 Answers
          4






          active

          oldest

          votes








          4 Answers
          4






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          66














          You can do this by concatenating the string to the file inline. I'm sure there's an easier way to concatenate strings and files, but it works.



          cat <(echo "SET FOREIGN_KEY_CHECKS=0;") imports.sql | mysql


          I don't think you need to set it back to 1 since it's just one session.






          share|improve this answer
























          • This looks like the best way. It's surprising mysqldump doesn't have a --disable-foreign-keys option.

            – Barmar
            Apr 11 '13 at 0:53






          • 3





            @Barmar remember that foreign keys are a product of the InnoDB engine rather than MySQL itself

            – Explosion Pills
            Apr 11 '13 at 1:01











          • Thanks, that is working! So setting FK checks only works for one command, rather than persisting across multiple commands?

            – DisgruntledGoat
            Apr 11 '13 at 16:25








          • 2





            @ExplosionPills @Barmar just ran into another issue, how would I disable FK checks on the actual data import? My table has an FK to itself that may reference a later ID. My import command is mysqlimport [user/pass] --local --fields-terminated-by="|" database "table.txt"

            – DisgruntledGoat
            Apr 18 '13 at 23:14






          • 1





            Anybody know how to do this in Windows? :/

            – Charles Wood
            Nov 5 '13 at 18:15
















          66














          You can do this by concatenating the string to the file inline. I'm sure there's an easier way to concatenate strings and files, but it works.



          cat <(echo "SET FOREIGN_KEY_CHECKS=0;") imports.sql | mysql


          I don't think you need to set it back to 1 since it's just one session.






          share|improve this answer
























          • This looks like the best way. It's surprising mysqldump doesn't have a --disable-foreign-keys option.

            – Barmar
            Apr 11 '13 at 0:53






          • 3





            @Barmar remember that foreign keys are a product of the InnoDB engine rather than MySQL itself

            – Explosion Pills
            Apr 11 '13 at 1:01











          • Thanks, that is working! So setting FK checks only works for one command, rather than persisting across multiple commands?

            – DisgruntledGoat
            Apr 11 '13 at 16:25








          • 2





            @ExplosionPills @Barmar just ran into another issue, how would I disable FK checks on the actual data import? My table has an FK to itself that may reference a later ID. My import command is mysqlimport [user/pass] --local --fields-terminated-by="|" database "table.txt"

            – DisgruntledGoat
            Apr 18 '13 at 23:14






          • 1





            Anybody know how to do this in Windows? :/

            – Charles Wood
            Nov 5 '13 at 18:15














          66












          66








          66







          You can do this by concatenating the string to the file inline. I'm sure there's an easier way to concatenate strings and files, but it works.



          cat <(echo "SET FOREIGN_KEY_CHECKS=0;") imports.sql | mysql


          I don't think you need to set it back to 1 since it's just one session.






          share|improve this answer













          You can do this by concatenating the string to the file inline. I'm sure there's an easier way to concatenate strings and files, but it works.



          cat <(echo "SET FOREIGN_KEY_CHECKS=0;") imports.sql | mysql


          I don't think you need to set it back to 1 since it's just one session.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 11 '13 at 0:32









          Explosion PillsExplosion Pills

          152k38230318




          152k38230318













          • This looks like the best way. It's surprising mysqldump doesn't have a --disable-foreign-keys option.

            – Barmar
            Apr 11 '13 at 0:53






          • 3





            @Barmar remember that foreign keys are a product of the InnoDB engine rather than MySQL itself

            – Explosion Pills
            Apr 11 '13 at 1:01











          • Thanks, that is working! So setting FK checks only works for one command, rather than persisting across multiple commands?

            – DisgruntledGoat
            Apr 11 '13 at 16:25








          • 2





            @ExplosionPills @Barmar just ran into another issue, how would I disable FK checks on the actual data import? My table has an FK to itself that may reference a later ID. My import command is mysqlimport [user/pass] --local --fields-terminated-by="|" database "table.txt"

            – DisgruntledGoat
            Apr 18 '13 at 23:14






          • 1





            Anybody know how to do this in Windows? :/

            – Charles Wood
            Nov 5 '13 at 18:15



















          • This looks like the best way. It's surprising mysqldump doesn't have a --disable-foreign-keys option.

            – Barmar
            Apr 11 '13 at 0:53






          • 3





            @Barmar remember that foreign keys are a product of the InnoDB engine rather than MySQL itself

            – Explosion Pills
            Apr 11 '13 at 1:01











          • Thanks, that is working! So setting FK checks only works for one command, rather than persisting across multiple commands?

            – DisgruntledGoat
            Apr 11 '13 at 16:25








          • 2





            @ExplosionPills @Barmar just ran into another issue, how would I disable FK checks on the actual data import? My table has an FK to itself that may reference a later ID. My import command is mysqlimport [user/pass] --local --fields-terminated-by="|" database "table.txt"

            – DisgruntledGoat
            Apr 18 '13 at 23:14






          • 1





            Anybody know how to do this in Windows? :/

            – Charles Wood
            Nov 5 '13 at 18:15

















          This looks like the best way. It's surprising mysqldump doesn't have a --disable-foreign-keys option.

          – Barmar
          Apr 11 '13 at 0:53





          This looks like the best way. It's surprising mysqldump doesn't have a --disable-foreign-keys option.

          – Barmar
          Apr 11 '13 at 0:53




          3




          3





          @Barmar remember that foreign keys are a product of the InnoDB engine rather than MySQL itself

          – Explosion Pills
          Apr 11 '13 at 1:01





          @Barmar remember that foreign keys are a product of the InnoDB engine rather than MySQL itself

          – Explosion Pills
          Apr 11 '13 at 1:01













          Thanks, that is working! So setting FK checks only works for one command, rather than persisting across multiple commands?

          – DisgruntledGoat
          Apr 11 '13 at 16:25







          Thanks, that is working! So setting FK checks only works for one command, rather than persisting across multiple commands?

          – DisgruntledGoat
          Apr 11 '13 at 16:25






          2




          2





          @ExplosionPills @Barmar just ran into another issue, how would I disable FK checks on the actual data import? My table has an FK to itself that may reference a later ID. My import command is mysqlimport [user/pass] --local --fields-terminated-by="|" database "table.txt"

          – DisgruntledGoat
          Apr 18 '13 at 23:14





          @ExplosionPills @Barmar just ran into another issue, how would I disable FK checks on the actual data import? My table has an FK to itself that may reference a later ID. My import command is mysqlimport [user/pass] --local --fields-terminated-by="|" database "table.txt"

          – DisgruntledGoat
          Apr 18 '13 at 23:14




          1




          1





          Anybody know how to do this in Windows? :/

          – Charles Wood
          Nov 5 '13 at 18:15





          Anybody know how to do this in Windows? :/

          – Charles Wood
          Nov 5 '13 at 18:15













          77














          You can also use --init-command parameter of mysql command.



          I.e.: mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" ...



          MySQL 5.5 Documentation - mysql options






          share|improve this answer





















          • 5





            This is the best solution, better than the answer of "Explosion Pills"

            – chris342423
            Sep 14 '16 at 9:45











          • i tried like : mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBname and i get You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBName' at line 1

            – Sushivam
            Nov 17 '16 at 6:38
















          77














          You can also use --init-command parameter of mysql command.



          I.e.: mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" ...



          MySQL 5.5 Documentation - mysql options






          share|improve this answer





















          • 5





            This is the best solution, better than the answer of "Explosion Pills"

            – chris342423
            Sep 14 '16 at 9:45











          • i tried like : mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBname and i get You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBName' at line 1

            – Sushivam
            Nov 17 '16 at 6:38














          77












          77








          77







          You can also use --init-command parameter of mysql command.



          I.e.: mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" ...



          MySQL 5.5 Documentation - mysql options






          share|improve this answer















          You can also use --init-command parameter of mysql command.



          I.e.: mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" ...



          MySQL 5.5 Documentation - mysql options







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 1 '16 at 3:28









          seangrieve

          945910




          945910










          answered Jan 14 '16 at 23:05









          WiktorWiktor

          1,5391923




          1,5391923








          • 5





            This is the best solution, better than the answer of "Explosion Pills"

            – chris342423
            Sep 14 '16 at 9:45











          • i tried like : mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBname and i get You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBName' at line 1

            – Sushivam
            Nov 17 '16 at 6:38














          • 5





            This is the best solution, better than the answer of "Explosion Pills"

            – chris342423
            Sep 14 '16 at 9:45











          • i tried like : mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBname and i get You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBName' at line 1

            – Sushivam
            Nov 17 '16 at 6:38








          5




          5





          This is the best solution, better than the answer of "Explosion Pills"

          – chris342423
          Sep 14 '16 at 9:45





          This is the best solution, better than the answer of "Explosion Pills"

          – chris342423
          Sep 14 '16 at 9:45













          i tried like : mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBname and i get You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBName' at line 1

          – Sushivam
          Nov 17 '16 at 6:38





          i tried like : mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBname and i get You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" -u root -p DBName' at line 1

          – Sushivam
          Nov 17 '16 at 6:38











          14














          Just another one to do the same:



          { echo "SET FOREIGN_KEY_CHECKS=0;" ; cat imports.sql ; } | mysql





          share|improve this answer





















          • 1





            Thanks, this was perfect since I was zcating my other file.

            – Aaron R.
            Feb 24 '17 at 18:33
















          14














          Just another one to do the same:



          { echo "SET FOREIGN_KEY_CHECKS=0;" ; cat imports.sql ; } | mysql





          share|improve this answer





















          • 1





            Thanks, this was perfect since I was zcating my other file.

            – Aaron R.
            Feb 24 '17 at 18:33














          14












          14








          14







          Just another one to do the same:



          { echo "SET FOREIGN_KEY_CHECKS=0;" ; cat imports.sql ; } | mysql





          share|improve this answer















          Just another one to do the same:



          { echo "SET FOREIGN_KEY_CHECKS=0;" ; cat imports.sql ; } | mysql






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Sep 19 '14 at 11:17









          Patrick Kostjens

          4,31262439




          4,31262439










          answered Jan 31 '14 at 21:25









          fx991fx991

          14112




          14112








          • 1





            Thanks, this was perfect since I was zcating my other file.

            – Aaron R.
            Feb 24 '17 at 18:33














          • 1





            Thanks, this was perfect since I was zcating my other file.

            – Aaron R.
            Feb 24 '17 at 18:33








          1




          1





          Thanks, this was perfect since I was zcating my other file.

          – Aaron R.
          Feb 24 '17 at 18:33





          Thanks, this was perfect since I was zcating my other file.

          – Aaron R.
          Feb 24 '17 at 18:33











          4














          Login to mysql command line:



          mysql -u <username> -p -h <host_name or ip> Then run



          1 SET FOREIGN_KEY_CHECKS=0;



          2 SOURCE /pathToFile/backup.sql;



          3 SET FOREIGN_KEY_CHECKS=1;



          Do not try to run directly from MySQL command line.






          share|improve this answer


























          • I'm confused. Don't your instructions imply that you should be running this directly from the MySQL command line?

            – Jeremy Dennen
            Apr 10 at 20:44











          • @JeremyDennen Yes, run it from mysql command line.

            – deepak
            Apr 11 at 7:16











          • You may want to update your answer to clarify that then. Currently it says do not run directly from MySQL command line

            – Jeremy Dennen
            10 hours ago
















          4














          Login to mysql command line:



          mysql -u <username> -p -h <host_name or ip> Then run



          1 SET FOREIGN_KEY_CHECKS=0;



          2 SOURCE /pathToFile/backup.sql;



          3 SET FOREIGN_KEY_CHECKS=1;



          Do not try to run directly from MySQL command line.






          share|improve this answer


























          • I'm confused. Don't your instructions imply that you should be running this directly from the MySQL command line?

            – Jeremy Dennen
            Apr 10 at 20:44











          • @JeremyDennen Yes, run it from mysql command line.

            – deepak
            Apr 11 at 7:16











          • You may want to update your answer to clarify that then. Currently it says do not run directly from MySQL command line

            – Jeremy Dennen
            10 hours ago














          4












          4








          4







          Login to mysql command line:



          mysql -u <username> -p -h <host_name or ip> Then run



          1 SET FOREIGN_KEY_CHECKS=0;



          2 SOURCE /pathToFile/backup.sql;



          3 SET FOREIGN_KEY_CHECKS=1;



          Do not try to run directly from MySQL command line.






          share|improve this answer















          Login to mysql command line:



          mysql -u <username> -p -h <host_name or ip> Then run



          1 SET FOREIGN_KEY_CHECKS=0;



          2 SOURCE /pathToFile/backup.sql;



          3 SET FOREIGN_KEY_CHECKS=1;



          Do not try to run directly from MySQL command line.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 11 at 7:16

























          answered Apr 18 '18 at 14:48









          deepakdeepak

          46638




          46638













          • I'm confused. Don't your instructions imply that you should be running this directly from the MySQL command line?

            – Jeremy Dennen
            Apr 10 at 20:44











          • @JeremyDennen Yes, run it from mysql command line.

            – deepak
            Apr 11 at 7:16











          • You may want to update your answer to clarify that then. Currently it says do not run directly from MySQL command line

            – Jeremy Dennen
            10 hours ago



















          • I'm confused. Don't your instructions imply that you should be running this directly from the MySQL command line?

            – Jeremy Dennen
            Apr 10 at 20:44











          • @JeremyDennen Yes, run it from mysql command line.

            – deepak
            Apr 11 at 7:16











          • You may want to update your answer to clarify that then. Currently it says do not run directly from MySQL command line

            – Jeremy Dennen
            10 hours ago

















          I'm confused. Don't your instructions imply that you should be running this directly from the MySQL command line?

          – Jeremy Dennen
          Apr 10 at 20:44





          I'm confused. Don't your instructions imply that you should be running this directly from the MySQL command line?

          – Jeremy Dennen
          Apr 10 at 20:44













          @JeremyDennen Yes, run it from mysql command line.

          – deepak
          Apr 11 at 7:16





          @JeremyDennen Yes, run it from mysql command line.

          – deepak
          Apr 11 at 7:16













          You may want to update your answer to clarify that then. Currently it says do not run directly from MySQL command line

          – Jeremy Dennen
          10 hours ago





          You may want to update your answer to clarify that then. Currently it says do not run directly from MySQL command line

          – Jeremy Dennen
          10 hours ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f15938786%2fdisabling-foreign-key-checks-on-the-command-line%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas