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

后端 未结 2 2035
[愿得一人]
[愿得一人] 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
    
    0 讨论(0)
  • 2021-02-20 08:26

    By any chance if you use SQLYog. Use this property.

    0 讨论(0)
提交回复
热议问题