Matt, thanks for your reply, this weekend I was thinking the way to do this work, because I use many times the same temporary table name for different scripts with different table structure.
 
All my temp tables begin with 'TMP', I thought grant something like 'TMP%' on tables_priv.table_name but looking in mysql's manual this doesn't work.
 
But there is a tricky, if you know the names of your temp tables you can make an insert on tables_priv with the table name:
 
INSERT INTO tables_priv (host, db, user, table_name, grantor, table_priv, column_priv) VALUES ('host.localdomain','db1','user1','TMP_Liq', USER(), 'Select,Insert,Update,Delete,Alter,Drop,Index','')
 
and this work!
 
Alejandro

 
-------Mensaje original-------
 
De: Matt W
Fecha: sábado 13 de diciembre de 2003 22:36:54
Asunto: Re: Temporary tables rights
 
Hi Alejandro,
 
Yeah, this issue has come up before. It's not possible to GRANT DROP on
temp tables without GRANTing DROP on the whole database.
 
The temp tables will be dropped when the client disconnects you know,
right? And if you want to empty the table or reuse it, you should be
able to TRUNCATE it, I think.
 
And actually, if you can TRUNCATE the other tables (if the DELETE
privilege allows it), isn't that just as bad as DROPping them? :-)
 
 
Matt
 
 
----- Original Message -----
From: adburne
Sent: Friday, December 12, 2003 11:31 AM
Subject: Temporary tables rights
 
 
Hi, I'm granting users to use temporary tables as:
 
GRANT CREATE TEMPORARY TABLES ON db1.* TO user1;
 
and having grants on many other tables as:
 
GRANT SELECT, INSERT, UPDATE, DELETE ON db1.table1 TO user1;
GRANT SELECT, INSERT, UPDATE, DELETE ON db1.table2 TO user1;
.....
 
but how make this work
 
>CREATE TEMPORARY TABLE tmp1 AS SELECT * FROM table1;
>ok
 
>SELECT * FROM tmp1;
>Error: select command denied to user: [EMAIL PROTECTED] for table tmp1
 
also:
>DROP TABLE tmp1;
>Error: drop command denied to user: [EMAIL PROTECTED] for table tmp1
 
I don't want grant select and "drop" global privilege over db1 but I
want use temporary tables, there is a way to do this work?
 
Alejandro
.
_________________________________________________________________
  IncrediMail - El E-mail ha evolucionado finalmente - Haga clic aquí

Reply via email to