Mysql Stored Proceedure: DEFINER=`root`@`%` is not working in localhost

mysql, php, stored-procedures

Solution

The message is quite clear that user does not exist.

In MySQL a user account consists of both the user name and the host definition component.

Either change the definer to `'root'@'localhost'` or create a user for `'root'@'%'`

Problem

I have searched on this problem a lot but could not find solution. I am using stored procedure: ``` DELIMITER $$ CREATE DEFINER=`root`@`%` PROCEDURE `GetImages`( in search Varchar(80) ) BEGIN select image_path from check_images where checkNumber=search; END ``` It is not working in localhost and getting following Error: Error Number: 1449 The user specified as a definer ('root'@'%') does not exist But if I replace % sign with "localhost" ('root'@'localhost') then everything works perfect. Also I am not allowed to alter the stored procedure. So please tell me the best solution that how can I overcome this problem. I'll appreciate any help. Thanks

Original source