Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

execute command denied to user readonlyuser

Tags:

php

mysql

Although localhost has execute permission, I'm getting error below when I run query in my web application. What I did normally solves problem of other users in this and other forums but for some reason doesn't solve mine unless I'm missing something.

Note: When I run same query in navicat or anywhere else, it works fine.

Is there anything else to solve this problem?

Thanks

QUERY:

SELECT
get_balance('$deadline', '$id') AS Balance,
allow_submission('$id', '$term') AS Over
FROM dual

ERROR:

execute command denied to user 'readonlyuser'@'localhost' for routine 'mydb.allow_submission'

WHAT I DID: In Navicat GUI and Linux terminal as root and superuser.

GRANT EXECUTE ON PROCEDURE mydb.allow_submission TO 'readonlyuser'@'localhost';
like image 236
BentCoder Avatar asked May 14 '13 10:05

BentCoder


1 Answers

As you are passing parameters to allow_submission, I think, that it's a function, not a procedure.

Try this:

GRANT EXECUTE ON FUNCTION mydb.allow_submission TO 'readonlyuser'@'localhost';
like image 57
user4035 Avatar answered Sep 22 '22 15:09

user4035