| 1 |
truncate performance_schema.status_by_account; |
| 2 |
truncate performance_schema.status_by_host; |
| 3 |
truncate performance_schema.status_by_user; |
| 4 |
truncate performance_schema.status_by_thread; |
| 5 |
SELECT thread_id INTO @my_thread_id |
| 6 |
FROM performance_schema.threads |
| 7 |
WHERE processlist_id = connection_id(); |
| 8 |
CREATE USER user1@localhost; |
| 9 |
GRANT ALL ON *.* to 'user1'@localhost; |
| 10 |
SELECT * FROM performance_schema.status_by_account WHERE user = 'user1' AND variable_name = 'Opened_tables'; |
| 11 |
USER HOST VARIABLE_NAME VARIABLE_VALUE |
| 12 |
user1 localhost # 0 |
| 13 |
SELECT * FROM performance_schema.status_by_host WHERE host = 'localhost' AND variable_name = 'Opened_tables'; |
| 14 |
HOST VARIABLE_NAME VARIABLE_VALUE |
| 15 |
localhost Opened_tables # |
| 16 |
SELECT * FROM performance_schema.status_by_user WHERE user = 'user1' AND variable_name = 'Opened_tables'; |
| 17 |
USER VARIABLE_NAME VARIABLE_VALUE |
| 18 |
user1 Opened_tables # |
| 19 |
SELECT * FROM performance_schema.status_by_thread WHERE thread_id = @my_thread_id AND variable_name = 'Opened_tables'; |
| 20 |
THREAD_ID VARIABLE_NAME VARIABLE_VALUE |
| 21 |
tid Opened_tables # |
| 22 |
DROP USER user1@localhost; |