Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skip or ignore definers in Mysqldump

I was wondering if I can prevent mysqldump inserting this commands

/*!50017 DEFINER=`root`@`localhost`*/

Or if I have to do it afterwards with sed, for example

Thanks!

like image 294
Emilio Nicolás Avatar asked Aug 10 '12 12:08

Emilio Nicolás


1 Answers

This issue has been around since 2006 with no sign of ever being fixed.

I have, however, piped it through grep (linux only) to trim out the definer lines before writing the dump file:

mysqldump -u dbuser -p dbname | grep -v 'SQL SECURITY DEFINER' > dump.sql

A bit of a mouthful (or keyboardful?) but I think it's the only way.

like image 90
NickJ Avatar answered Oct 22 '22 04:10

NickJ