4

As a part of a migration, I need to export MySQL events from a MySQL 5.6 cluster and import them in a MySQL 5.7 cluster

Is copying the table mysql.event enough for this or is there any better way to export only events from a MySQL database?

Bill Karwin
  • 538,548
  • 86
  • 673
  • 828
ProT-0-TypE
  • 283
  • 2
  • 9
  • Do you mean some "events" table of your database or your cluster events log? For a database table you can export data with mysqldump or "select data ... outfile", or use some third-party backup tool. – Oleg Loginov Nov 05 '17 at 22:18
  • I mean mysql "events" that you can see with SHOW EVENTS. I need to export events only, not other data. I'm not sure if just dumping `mysql.event` is enough to achieve that – ProT-0-TypE Nov 05 '17 at 22:46

1 Answers1

9

I tried this:

mysqldump -A --no-data --no-create-info --skip-triggers --no-create-db \
   --events > just-events.sql

It seems to dump only events.

Bill Karwin
  • 538,548
  • 86
  • 673
  • 828