Tuesday, January 8, 2013

MYSQL : "THE USER SPECIFIED AS A DEFINER ('ROOT'@'%') DOES NOT EXIST"

The source code for the stored procedures that you have been loading probably contain "DEFINER=root@'%'" as part of the definition - looking a bit like this:
create definer='root'@'%' procedure sp_test() begin end;
The problem here is that you do not have an account on your system for 'root'@'%'. This can be easily demonstrated. From the MySQL command line:
show grants for 'root'@'%';
I expect that this will come back with an error message:
ERROR 1141 (42000): There is no such grant defined for user 'root' on host '%'
The fix is to alter the source of your stored procedures, or to create the missing account:
grant all on *.* to 'root'@'%' identified by 'password' with grant option;
It is not generally a good idea to have such a high-powered account accessible from anywhere, but that is another story.