If you encounter an error like the following while doing a mysql import mysqldump, there are DEFINER statements in the database dump file. The easy way to get past this problem is to remove the DEFINER statements from the Mysql dump file.

The error message you’ll see is:

The easiest way to remove them is to run the following command:

After that, re-run the database import.

Why does this happen when mysqldump?

During exports, stored procedures and triggers are exported with references to the current username. This happens independent of how you back up or export your database. The username at time of export is custom to your hosting setup. When you then try to import this dump on another server, where you most often use another username to connect to the database, the username in the database dump file does not match the currently active user.

Previous ArticleNext Article

Leave a Reply

Your email address will not be published. Required fields are marked *