Hi,
I ran the code below on two different versions, 4.0.14 and 4.0.16
respectively, both running RH 7.3 on intel.
In version mysql server version 4.0.14 the SELECT privelege suffices
for "optimize table", but (seemingly) the server version 4.0.16
requires INSERT as well.
Is the INSERT privelege necessary for performing optimize in mysql
server version >= 4.0.16 ? I haven't found anything on this in the
changelogs, but I guess I might have missed something.
################################################## ##########################
Server 1:
mysql> select version();
+------------+
| version() |
+------------+
| 4.0.14-Max |
+------------+
1 row in set (0.03 sec)
mysql> GRANT SELECT ON mydb.tq TO tqoptimizer@localhost IDENTIFIED BY
'XXX';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[16:05:ro**@4.0.14-server] $ /usr/bin/mysql -u tqoptimizer
--password=XXX -e 'optimize table tq' mydb
+-----------+----------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+-----------+----------+----------+----------+
| mydb.tq | optimize | status | OK |
+-----------+----------+----------+----------+
################################################## ##########################
Server 2:
mysql> select version();
+----------------+
| version() |
+----------------+
| 4.0.16-Max-log |
+----------------+
1 row in set (0.00 sec)
mysql> GRANT SELECT ON mydb.tq TO tqoptimizer@localhost IDENTIFIED BY
'XXX';
Query OK, 0 rows affected (0.00 sec)
mysql> exit;
Bye
[16:09:ro**@4.0.16-server:] $ /usr/bin/mysql -u tqoptimizer
--password=XXX -e 'optimize table tq' mydb
ERROR 1142 at line 1: insert command denied to user:
'tqoptimizer@localhost' for table 'tq'
################################################## ##########################
--
Andreas