MySQL user permission on stored procedure I've created a simple stored procedure:

mysql&gt; CREATE FUNCTION hello (s CHAR(20))
    -&gt; RETURNS CHAR(50) DETERMINISTIC
    -&gt; RETURN CONCAT('Hello, ',s,'!');
Query OK, 0 rows affected, 1 warning (0.00 sec)


But failed to run it:

mysql&gt; SELECT hello('world');
ERROR 1370 (42000): execute command denied to user ''@'localhost' for routine 'test.hello'


Is it possible that my user name is an empty string? How do I create users and grant privileges? Can I grant a user all the privileges on all entities within a database?
As the error message itself says that  user do not have the execute permissions.

mysql&gt; SELECT hello('world');
ERROR 1370 (42000): execute command denied to user ''@'localhost' for routine 'test.hello'


You need to grant the Execute Permission to that user.For that you need to login as root user and grant the permission as 

 grant execute on db.* to user@localhost;


For your other queries :


Yes It is possible that your username is an empty string but it is not safe to create the users like this.
For creating and granting privileges in brief  have a look at This Link.    
Yes you can grant  all the privileges on all entities within a database.
for this you can execute a command like 


Login as root user and issue a command

GRANT ALL ON DB_NAME.* TO 'USER'@'HOST' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;