Bug #9952 | changing privileges with grant command takes effect only after FLUSH PRIVILEGES | ||
---|---|---|---|
Submitted: | 16 Apr 2005 14:22 | Modified: | 16 Apr 2005 19:37 |
Reporter: | Gleb Paharenko | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.1.11 | OS: | Linux (Linux) |
Assigned to: | CPU Architecture: | Any |
[16 Apr 2005 14:22]
Gleb Paharenko
[16 Apr 2005 15:30]
Gleb Paharenko
Another example: mysql> delete from mysql.user where user='testuser'; Query OK, 1 row affected (0.01 sec) mysql> flush privileges; Query OK, 0 rows affected (0.01 sec) mysql> grant all on testdb.* to testuser@"%.ensita.net"; Query OK, 0 rows affected (0.00 sec) mysql> grant select on testdb.* to testuser@"%"; Query OK, 0 rows affected (0.00 sec) mysql> Bye [gleb@toyou mysql-debug-4.1.11-pc-linux-gnu-i686]$ ./bin/mysql --defaults-file=my.cnf -htoyou.ensita.net -utestuser testdb Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 62 to server version: 4.1.11-debug-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show grants for current_user(); +-----------------------------------------------------------------+ | Grants for testuser@%.ensita.net | +-----------------------------------------------------------------+ | GRANT USAGE ON *.* TO 'testuser'@'%.ensita.net' | | GRANT ALL PRIVILEGES ON `testdb`.* TO 'testuser'@'%.ensita.net' | +-----------------------------------------------------------------+ 2 rows in set (0.00 sec) mysql> insert into testdb.testtable set a=7; ERROR 1044 (42000): Access denied for user 'testuser'@'%.ensita.net' to database 'testdb' mysql> Bye [gleb@toyou mysql-debug-4.1.11-pc-linux-gnu-i686]$ ./bin/mysql --defaults-file=my.cnf -uroot -e 'flush privileges;' [gleb@toyou mysql-debug-4.1.11-pc-linux-gnu-i686]$ ./bin/mysql --defaults-file=my.cnf -htoyou.ensita.net -utestuser testdb Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 64 to server version: 4.1.11-debug-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show grants for current_user(); +----------------------------------------------+ | Grants for testuser@% | +----------------------------------------------+ | GRANT USAGE ON *.* TO 'testuser'@'%' | | GRANT SELECT ON `testdb`.* TO 'testuser'@'%' | +----------------------------------------------+ 2 rows in set (0.00 sec)
[16 Apr 2005 15:34]
Gleb Paharenko
See also thread: http://lists.mysql.com/mysql/182637
[16 Apr 2005 19:37]
Jorge del Conde
Hi! I was unable to reproduce this bug with a recent 4.1.11 bk pull.