sed -i 's/DEFINER=[^*]*\*/\*/g' mydump.sql
In macOS:
sed -i '' 's/DEFINER=[^*]*\*/\*/g' mydump.sql
You also export the file already without the definers:
mysqlpump -u user -p -h localhost database | sed -i 's/DEFINER=[^*]*\*/\*/g' > mydump.sql
On macOs:
mysqlpump -u user -p -h localhost database | sed -i '' 's/DEFINER=[^*]*\*/\*/g' > mydump.sql
When you're gonna backup the database you can use the option --skip-definer
to create the dump already without the definers:
mysqlpump -u user --password='password' -h localhost --skip-definer database > database-no-definers.sql
More info here: https://dev.mysql.com/doc/refman/5.7/en/mysqlpump.html#option_mysqlpump_skip-definer