"alter routine command denied to user" error when installing extensions?
The user does not have the permissions to alter and create routines (functions). This should fix it:

GRANT CREATE ROUTINE, ALTER ROUTINE ON civicrm.* TO civicrm;