Kene egy kis segitseg.

Elakadtam egy latszolag egyszeru konfiguralassal.
Egy CGI program turkal egy mysql adatbazisban 'auction' neven.
Az adott usernek csak annyi irasi jogot akarod adni,
amennyi feltetlenul muszaj. Tehat ugy kepzeltem, hogy a
'sellers' tablat olvashatja, de csak bizonyos oszlopait irhatja:

mysql> select * from tables_priv where user='auction' and table_name 
='auctions' \G 
*************************** 1. row ***************************
       Host: localhost
         Db: kmt
       User: auction
 Table_name: auctions
    Grantor: 
  Timestamp: 2006-09-15 09:43:25
 Table_priv: Select
Column_priv: 
1 row in set (0.00 sec)

mysql> select host,db,user,table_name,column_name,column_priv from columns_priv 
where user = 'auction' and table_name = 'sellers' ;
+-----------+-----+---------+------------+-------------------+-------------+
| host      | db  | user    | table_name | column_name       | column_priv |
+-----------+-----+---------+------------+-------------------+-------------+
| localhost | kmt | auction | sellers    | sellerid          |             |
| localhost | kmt | auction | sellers    | auctionid         |             |
| localhost | kmt | auction | sellers    | state             | Update      |
| localhost | kmt | auction | sellers    | registration_time | Update      |
| localhost | kmt | auction | sellers    | phone             | Update      |
| localhost | kmt | auction | sellers    | password          | Update      |
| localhost | kmt | auction | sellers    | name              | Update      |
| localhost | kmt | auction | sellers    | email             | Update      |
+-----------+-----+---------+------------+-------------------+-------------+
8 rows in set (0.01 sec)

--------

De nem engedi az update parancsot:

$ mysql -u auction -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 155 to server version: 4.1.11-Debian_4sarge7-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use kmt;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> UPDATE sellers SET name=NULL WHERE sellerid='foobar23';
ERROR 1142 (42000): UPDATE command denied to user 'auction'@'localhost' for 
table 'sellers'
mysql> 

(Ha tablaszinten engedelyezem az update-et, akkor megy.)

Mit nem vettem eszre?

kissg
_________________________________________________
linux lista      -      [email protected]
http://mlf2.linux.rulez.org/mailman/listinfo/linux

válasz