Skip to main content

Posts

Showing posts with the label replace

How to replace the definer Clause from Dump File Before migration in sql file dump

 How to Remove Definer Clause from Dump File Before Migrating a MySQL Database  if you have sed (for windows go to http://gnuwin32.sourceforge.net/packages/sed.htm ) available you can run  sed -E 's/DEFINER=`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' yoursqlfile.sql > outputsqlfile.sql  otherwise you can use on your preferred text editor as vim, notepad++ or emeditor (good for large files of several Terabytes) and  do a search/replace. search string: DEFINER=`[^`]+`@`[^`]+` replace string: DEFINER=CURRENT_USER  You can also remove the definer (empty string) instead of using your current user.