简体   繁体   中英

Mysql Disable trigger during database recovery

I need to recover a database with a data-only DB dump (made only of "insert"). I don't want to run triggers during this recovery, how can I do?

If you have the option of recreating the dump, use the --skip-triggers option when running it. You will have to recreate the triggers afterwards, but it's a lot less painful.

MySQL Trigger Docs

MySQL currently does not have this feature. Here are some links that may be of interest and give some ideas.

Also, if you have the ability, you can make:

  1. Backup triggers only
  2. Remove all triggers
  3. Restore database
  4. Create triggers again

It's more work, but a workaround to lack of feature.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM