Pages

Search This Blog

Monday, March 21, 2011

Unable to retrieve stored procedure metadata. Either grant SELECT privilege to mysql.proc for this user or use "use procedure bodies=false" with your connection string.

Error receive when trying access to mysql database using windows application.
"Unable to retrieve stored procedure metadata. Either grant SELECTprivilege to mysql.proc for this user or use "use procedure bodies=false" with your connection string."










I'm using user "mrptest" connect to database and user "mrptest" has been granted to all privilage. The stored procedure created using 'root'@'localhost'.

To overcome this problem, i need to to drop all the created database and change the statement from CREATE DEFINER=`root`@`localhost` PROCEDURE to CREATE DEFINER=`mrptest`@`%` PROCEDURE

DELIMITER $$

DROP PROCEDURE IF EXISTS `psp_AAA` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `psp_AAA`()
BEGIN

END $$

DELIMITER ;

Now i change to

DELIMITER $$

DROP PROCEDURE IF EXISTS `psp_AAA` $$
CREATE DEFINER=`mrptest`@`%` PROCEDURE `psp_AAA`()
BEGIN

END $$

DELIMITER ;

Problem solved.

No comments: