mysql export sql dump alphabatically,which cause foreign key constraints error during import

后端 未结 2 2037
[愿得一人]
[愿得一人] 2021-02-20 07:38

I have 10 tables in my database(MySQL). two of them is given below

tbl_state

state_id    |int(10)  |UNSIGNED ZEROFILL  auto_increment 
         


        
2条回答
  •  被撕碎了的回忆
    2021-02-20 08:03

    You want to disable foreign key checks at start of the dump, and then enable them after all the data is dumped:

    SET FOREIGN_KEY_CHECKS=0
    
    ... dump ...
    
    SET FOREIGN_KEY_CHECKS=1
    

提交回复
热议问题