Nitin Kabra
Nitin Kabra

Reputation: 3226

MySql stored procedure call error

I am getting the following error on calling a MySql stored procedure from phpMyAdmin

#1045 - Access denied for user 'root'@'localhost' (using password: NO) 

I am using

call get_ledger_name(2007);

to call the procedure

I have tried changing password for root, creating a new user, but the error still prevails.

Upvotes: 2

Views: 2328

Answers (2)

Saharsh Shah
Saharsh Shah

Reputation: 29051

Alter stored procedure with DEFINER=root@localhost and then call this SP. It will run.

Try this:

DELIMITER $$

DROP PROCEDURE IF EXISTS `sp_test`$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_test`()
BEGIN
/* Your Code Snippet */
/* Your Code Snippet */
/* Your Code Snippet */
END$$

DELIMITER ;

Upvotes: 2

John Woo
John Woo

Reputation: 263683

Actually you can reset the root password.

But keep in mind that it is not advisable to use root account without password.

Upvotes: 1

Related Questions