Error cause by DEFINER in MySQL-dumps

When importing MySQL- dumps of a Magento database sometimes you get an error message like that (although you can connect to the database via shell f.e.):

In these cases you’ ll recognize that the user, who tries to connect, is wrong (not the user defined in the mysql-call).

This is caused by  DEFINER declarations in the create statements of the MySQL-dump that Magento exports (or mysqldump too).
For example:

The problem can be solved by removing the wrong DEFINER declaration via sed:

Another good idea is it to remove it during mysqldump:

This replaces the DEFINER row with this:

So you can import the dump on every machine with every user.

Leave a Reply

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

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.