How to change the definer for views
Run this SQL to generate the necessary ALTER statements
SELECT CONCAT(“ALTER DEFINER=`youruser`@`host` VIEW “,
table_name, ” AS “, view_definition, “;”)
FROM information_schema.views
WHERE table_schema=’your-database-name’;
Copy and run the ALTER statements
How to change the definer for stored procedures
Example:
UPDATE `mysql`.`proc` p SET definer = ‘user@%’ WHERE definer=’root@%’