Why this error happens?
Most of the times, reason is that your database dump through command line or PhpMyAdmin or even other libraries can have SQL’s Definer statements. Now, as per MySQL’s Official Documentation:
The
MySQL Reference Manual v8.0DEFINER
clause specifies the MySQL account to be used when checking access privileges at routine execution time for routines that have theSQL SECURITY DEFINER
characteristic.
Solution: MySQL mysqldump create a safe backup to ensure no corruption
Use the following command to create backup of your mysql database. Put the command in terminal
mysqldump -hHOST -uUSERNAME -p DATABASE_NAME | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' > BACKUP_NAME.sql
With gzip compression > backup
mysqldump -hHOST -uUSERNAME -p DATABASE_NAME | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | gzip > BACKUP_NAME.sql
Reference: https://stackoverflow.com/a/9447215/2229148
Leave a Reply