5

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?

2 Answers 2

3

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

Sign up to request clarification or add additional context in comments.

Comments

2

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.

2 Comments

How to backup triggers? May I use mysqldump?
@Tobia: Yes, mysqldump is an option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.