Access denied in MySQL, even though GRANTS looks right

2.2k Views Asked by At

I'm trying to create a stored proc in MySQL.

When I try and run it, I get the error:

Access denied for user: '<myuser>' to database '<mydb>'

However when I look at the GRANTS for this user I get:

GRANT USAGE ON *.* TO '<myuser>'@'%' IDENTIFIED BY PASSWORD '<blah>' 
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON `<mydb>`.* TO '<myuser>'@'%' 

I can create / drop / alter tables no problem, just no joy with the stored proc.

(The database is hosted by my ISP / Web Host)

1

There are 1 best solutions below

0
On

To create stored procedures you need CREATE ROUTINE privilege. To execute them you need EXECUTE privilege.

Check this out: http://dev.mysql.com/doc/refman/5.0/en/stored-routines-privileges.html