How do I fix «The user specified as a definer ('<user>'@'%') does not exist»?

mysql

(Dmitry Fedyuk) #1
GRANT ALL ON *.* TO <user>'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

stackoverflow.com/a/39701619


(Dmitry Fedyuk) #2

Another solution:

mysqldump <database> > dump.sql
sed -i 's/DEFINER=`<name>`@`<host>`//g' dump.sql
mysql -e "DROP DATABASE <database>; CREATE DATABASE <database>;" && mysql <database> < dump.sql