How do I use GRANT in mysql to assign priviledges ?
Posted on 2010-09-07
I have a mysql database online. I have created a user for e.g. mysite_user1. This user is associated with 2 databases.
1. DBSet1 (has couple of tables)
2. DBSet2 (has one table)
Now for DBSet1, user1 has select priviledge only and for dbset2 user has several priviledges which I have assigned thru wizard.
I want to create a stored procedure in DBSet1 and want user1 to execute stored procedures. How can I grant priviledge so that it can execute any no. of stores procedure and maintain its current select only priviledge for database DBSet1.
I mean hwo can I achieve the following :
- Grant user1 to execute any no. of stores procedures in Dbset1.
- Grant user1 to execute only a particular stored procedure in DBSet1.
- Ensure that its previous priviledge is intact (Select).
- priviledge should be for all tables in DBSet1.
Can someone write sample grant statements to achieve the same.
(For info: if the stored procedure contains update statement for that db I hope it works).
I will be glad if anyone can help me out.