HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Is it possible to backup stored routines and functions with Innobackupex?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
storedwithinnobackupexpossibleroutinesandfunctionsbackup

Problem

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.

Solution

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.

Code Snippets

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

Context

StackExchange Database Administrators Q#105411, answer score: 3

Revisions (0)

No revisions yet.