mysqlmysql-event

How to backup MySQL events with mysqldump?


I'm using the following mysqldump command to backup ma database:

mysqldump --extended-insert=FALSE -hlocalhost -uusername -ppassword --databases my_database > ${FILELOCAL}

This is working very well.

I this database I also have some scheduled events.

Unfortunately the backup file doesn't contain my scheduled events.

ATTENTION: I don't want to know how to schedule a backup with mysqldump. I want to know how to also backup my scheduled events when using mysqldump.


Solution

  • The solution is just to add --events like this:

    mysqldump --extended-insert=FALSE -hlocalhost -uusername -ppassword --databases my_database --events > ${FILELOCAL}