mysqldump -u root -pmysql db_name --routines | sed 's/DEFINER=`root`@`localhost`//g' > dump.sql
|
Hints
mysqldump -u root -pmysql db_name --routines
To take dump of the database and sed command is used to find and replace in a file.
sed 's/find-text/replace-text/g'
/g - means replace all matches
find and replacing DEFINER=`root`@`localhost` from dump file then create's dump.sql using > dump.sql expression
|