MySQL Backup – Backup Stored Routines and Functions with Innobackupex

backupmariadbMySQLpercona-toolsxtrabackup

I am running a few restore tests on my Dev and I've noticed that the stored routines are not being restored with the innobackupx. Is that something achievable ? Am I doing something wrong ?

I am only using innodb tables so it will be good to restore the db using only innobackupx.

Thank you.

Best Answer

In order to take the backup of MySQL Server Objects i.e routines / triggers / events you can do like below

mysqldump -h$MySQLHost -u$YourUser -p$YourPassword --no-data --no-create-info --routines --triggers --events $Database > MySQLStoredProcedures.sql

The above will backup only the database objects , no data , no create table etc.