Page 1 of 1

MySQL permissions issue

Posted: Tue Oct 17, 2006 8:45 am
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.

Posted: Tue Oct 17, 2006 10:02 am
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...