Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 24, 2012, 11:49:00 AM

Pages: [1]   Go Down
  Print  
Author Topic: How do you grant execute persmissioin on MySQL stored procedures  (Read 5288 times)
tx350z
Newbie
*
Offline Offline

Posts: 5


« on: June 06, 2011, 11:48:23 AM »

My databases are hosted on a LP shared server running MySQL version "5.0.<something>.ourdelta".

I can create stored procedures successfully. But there appears to be no way to grant EXECUTE permissions on stored procedures. I tried executing a GRANT statement using a database user that is supposed to have "ALL" rights - the GRANT fails due to lack of GRANT permission. It appears the only user that can execute them is the user that created them. This presents a problem when the stored procedures will be executed by a limit-rights user under which a web site runs.

So what gives? Are stored procedures supported on LP hosted MySQL databases? If so, exactly how does one grant EXECUTE permission to a user other than the one that created it?

Thanks.
Logged
tx350z
Newbie
*
Offline Offline

Posts: 5


« Reply #1 on: June 06, 2011, 01:00:38 PM »

I'd actually like to go one step beyond granting EXECUTE to a database user. I'd like to restrict that user to ONLY EXECUTE permission. Doing so greatly improves web site security and goes a long way towards eliminating SQL injection hacks.

The only problem is there appears to be no way to set the detailed rights granted to a database user since users with 'ALL' rights do not have GRANT and REVOKE rights.

Any possibility these rights can be granted to database users with "ALL" rights? Or may be a specified "admin" user?  PLEASE?  Head Bashin

Thanks in advance...
Logged
sbassette
Newbie
*
Offline Offline

Posts: 1


« Reply #2 on: July 12, 2011, 05:36:55 PM »

I believe that the reason why you are not able to issue the GRANT statement is because the GRANT ALL PRIVILEGES command does not transfer the GRANT OPTION privilege.  That which needs to be granted separately by someone else who has it (or root if no one has received it yet).  Once that has been done, you can create a new user with only the EXECUTE privilege.  If you would like to limit existing users and you have been granted ALL and GRANT OPTION then you can REVOKE all of their PRIVILEGES except EXECUTE.

Let me know if this achieves what you were hoping for.

http://dev.mysql.com/doc/refman/5.1/en/grant.html

Bassette
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: