Firstly, GRANT ALL PRIVILEGES ON test.* TO 'test'@'%' WITH GRANT OPTION;
would not grant privileges to the user when connecting from localhost
You need to grant privileges for localhost
separately
From the error it looks like you are disconnecting after the first DROP
and connecting again from localhost
.
Well, if you are executing these 4 statements one after the another, you should get the same result as you get with root
GRANT ALL PRIVILEGES ON test.* TO 'test'@'%' WITH GRANT OPTION;
CREATE PROCEDURE test.foo() SELECT NOW();
DROP PROCEDURE IF EXISTS test.foo;
DROP PROCEDURE IF EXISTS test.foo;
Let me know, if I have made my answer clear