MySQL permissions issue

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

MySQL permissions issue

Post by amir »

i have a database with few precreated tables.
i need to create new username that needs to access this database and to have full access to create and delete tables, except the precreated ones.

so, for example i have pretable1 and pretable2 created and i want to give the user read-only access to these tables, but also rights so user can create new tables and then to delete newly created tables.

how can i do this? just to mention, as maybe it is relevant to the issue, the tables user needs to create are temporary tables (TYPE=HEAP).

Thanks in advance.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Here is my first thought: (probably not the best... but here is it anyway)
I would suggest you write two stored procedures to perform the create/drop and grant the user to execute those sprocs instead of directly calling create/drop.
In those sprocs you can then check the table name etc...
Post Reply