1

When I request my database server (MySQL), with "show grants for current_user"

I notice that I have the grant to execute procedure:

SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, EXECUTE 

But when I execute a sql file that contains those instructions :

DROP FUNCTION IF EXISTS 
DROP FUNCTION IF EXISTS 
DROP PROCEDURE IF EXISTS
CREATE FUNCTION 
CREATE PROCEDURE
DECLARE
CALL

I have this error :

ERROR 1044 (42000) at line 16: Access denied for user

The line 16 contains : CREATE FUNCTION function_name( .. )

Should I have other grants ?

ypercubeᵀᴹ
  • 99,450
  • 13
  • 217
  • 306
4m1nh4j1
  • 177
  • 1
  • 4
  • 11

1 Answers1

5

From MySQL Documention:

The CREATE ROUTINE privilege is needed to create stored routines (procedures and functions).

Example:

GRANT CREATE ROUTINE, ALTER ROUTINE ON yourDB.* TO youUser;

Max

Maxime Fouilleul
  • 3,565
  • 25
  • 21