Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL: What happens to stored procedures, functions and triggers when dumping complete database with mysqldump

Tags:

mysql

I have been using mysqldump for backup purposes. We have a new database here with lots of functions, procedures and triggers. What happens to these functions or procedures or triggers if I take a complete database backup?

Will these triggers, functions and procedures also be dumped? Are there any precautions need to be taken in this kind of scenario?

like image 714
Uday Avatar asked Feb 21 '23 16:02

Uday


1 Answers

mysqldump will backup by default all the triggers but NOT the stored procedures/functions. There are 2 mysqldump parameters that control this behavior:

–routines (procedures and functions) – false by default
–triggers – true by default

http://www.ducea.com/2007/07/25/dumping-mysql-stored-procedures-functions-and-triggers/

like image 57
Pavel Strakhov Avatar answered Feb 23 '23 06:02

Pavel Strakhov