-
Type:
Bug
-
Status: Done
-
Priority:
Medium
-
Resolution: Fixed
-
Affects Version/s: 5.5.60-38.12, 5.6.40-84.0, 5.7.22-22
-
Fix Version/s: 5.7.25-28, 8.0.15-5, 5.6.44-85.0
-
Component/s: None
-
Labels:
-
Environment:
I suspect this impacts all 5.6 and 5.7 releases.
According to the docs, access_denied is supposed to count "The number of times this client's connections issued commands that were denied." I would assume this to include such things as trying to modify a table when connected as a user without insert/update privileges or when trying to write to a server that is set read-only when I don't have the super privilege. However, I've tried both scenarios and the access_denied counter never increments. For example:
mysql> show grants\G *************************** 1. row *************************** Grants for testme@%: GRANT SELECT, SHOW DATABASES ON *.* TO 'testme'@'%' IDENTIFIED BY PASSWORD <secret> 1 row in set (0.00 sec) mysql> create database foooo; ERROR 1044 (42000): Access denied for user 'testme'@'%' to database 'foooo'
And then in another session:
mysql> select * from information_schema.user_statistics where user='testme'\G
*************************** 1. row ***************************
USER: testme
TOTAL_CONNECTIONS: 1
CONCURRENT_CONNECTIONS: 0
CONNECTED_TIME: 241
BUSY_TIME: 0
CPU_TIME: 0
BYTES_RECEIVED: 102
BYTES_SENT: 0
BINLOG_BYTES_WRITTEN: 0
ROWS_FETCHED: 2
ROWS_UPDATED: 0
TABLE_ROWS_READ: 0
SELECT_COMMANDS: 2
UPDATE_COMMANDS: 1
OTHER_COMMANDS: 1
COMMIT_TRANSACTIONS: 0
ROLLBACK_TRANSACTIONS: 0
DENIED_CONNECTIONS: 0
LOST_CONNECTIONS: 0
ACCESS_DENIED: 0
EMPTY_QUERIES: 0
TOTAL_SSL_CONNECTIONS: 0
As best I can tell from reading the source code, there are just a lot of places where the appropriate counter isn't incremented.
- relates to
-
PS-4996 Broken fields in user statistics
-
- Done
-