I was wondering if I can prevent mysqldump inserting this commands
Or if I have to do it afterwards with sed, for example
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.