I have already googled and tried may suggestions but none seem to be able to remove all 'DEFINER=' occurrences.
Remove DEFINER clause from MySQL Dumps
These are some of the occurrences
/*!50013 DEFINER=`root`@`localhost`*/
/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */
/*!50013 DEFINER=`root`@`192.168.42.20` SQL SECURITY DEFINER */
And I have tried a different approach by attempting to replace everything up until the first space and while the regex works on regex101 it will not work in the command line with sed:
cat mydb.sql | grep DEFINER= | sed -e 's/DEFINER=[^\s]+/ /'
Any suggestions on how to get this to work with sed ?
Edit
After looking through this huge dump file I have also discovered som occurrences where there is no space at the end, instead there is a *, so I updated the test text above.
This is what appears to work:
's/DEFINER=[^ |\*]*//'