I work with multiple environments of the same database: A server dedicated to user tests (a stable one) and I have a local environment on my work computer.
There are times where I literally load my own database and have to pull up a backup, which I take from the user testing team.
The problem starts when I finish raising the backup on my local computer, because I receive a "The user specified as a definer ('testUser'@'%') does not exist".
This happens because in the test environment there are 2 "testuser", one for localhost and one for % (any domain), but on my local machine I don't have a "testUser" for any domain.
Although duplicating the user in my local environment solves the issue of the error, is there a way to massively change DEFINER=testUser@%
the user of all the routines in the database to the user I want?