Drop a non existing procedure in MySQL -
i'm using mysql 5.5.31 on fedora , have trouble dropping non existing procedure. root user:
- create new database: test
- create new user: test
give permissions user test database test
grant privileges on test.* 'test'@'%' grant option;
with user test
create procedure test.foo() select now(); drop procedure if exists test.foo; query ok, 0 rows affected (0.00 sec) drop procedure if exists test.foo; error 1370 (42000): alter routine command denied user 'test'@'localhost' routine 'test.foo'
why "if exists" not working?
if same root user works fine (with warning, okay):
with user test
create procedure test.foo() select now(); drop procedure if exists test.foo; query ok, 0 rows affected (0.00 sec) drop procedure if exists test.foo; query ok, 0 rows affected, 1 warning (0.00 sec)
firstly, grant privileges on test.* 'test'@'%' grant option;
not grant privileges user when connecting localhost
you need grant privileges localhost
separately
from error looks disconnecting after first drop
, connecting again localhost
.
well, if executing these 4 statements 1 after another, should same result root
grant privileges on test.* 'test'@'%' grant option; create procedure test.foo() select now(); drop procedure if exists test.foo; drop procedure if exists test.foo;
let me know, if have made answer clear
Comments
Post a Comment