nilnandan.joshi@bm-support01:~$ mysql -uroot -p --socket=/tmp/mysql_sandbox5544.sock
Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead.
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.44-37.3 Percona Server (GPL), Release 37.3, Revision 729fbe2
Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.13 sec)
mysql> use test
Database changed
mysql> show variables like 'userstat';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| userstat | OFF |
+---------------+-------+
1 row in set (0.02 sec)
mysql> set global userstat=ON;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like 'userstat';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| userstat | ON |
+---------------+-------+
1 row in set (0.00 sec)
mysql> insert into tu values(1),(2),(3);
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> select * from information_schema.table_statistics\G
*************************** 1. row *************************** TABLE_SCHEMA: test TABLE_NAME: tu ROWS_READ: 0 ROWS_CHANGED: 3
ROWS_CHANGED_X_INDEXES: 3
1 row in set (0.00 sec)
mysql> select * from information_schema.table_statistics\G
*************************** 1. row *************************** TABLE_SCHEMA: test TABLE_NAME: tu ROWS_READ: 0 ROWS_CHANGED: 3
ROWS_CHANGED_X_INDEXES: 3
1 row in set (0.00 sec)
Verified with 5.5
nilnandan. joshi@bm- support01: ~$ mysql -uroot -p --socket= /tmp/mysql_ sandbox5544. sock
Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead.
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.44-37.3 Percona Server (GPL), Release 37.3, Revision 729fbe2
Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases; ------- ------- + ------- ------- + ------- ------- +
+------
| Database |
+------
| information_schema |
| mysql |
| performance_schema |
| test |
+------
4 rows in set (0.13 sec)
mysql> use test ------- --+---- ---+ ------- --+---- ---+ ------- --+---- ---+
Database changed
mysql> show variables like 'userstat';
+------
| Variable_name | Value |
+------
| userstat | OFF |
+------
1 row in set (0.02 sec)
mysql> set global userstat=ON;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like 'userstat'; ------- --+---- ---+ ------- --+---- ---+ ------- --+---- ---+
+------
| Variable_name | Value |
+------
| userstat | ON |
+------
1 row in set (0.00 sec)
mysql> create table tu(id int primary key);
Query OK, 0 rows affected (0.12 sec)
mysql> insert into tu values(1),(2),(3);
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> select * from information_ schema. table_statistic s\G ******* ******* ****** 1. row ******* ******* ******* ******
TABLE_ SCHEMA: test
TABLE_ NAME: tu
ROWS_ READ: 0
ROWS_ CHANGED: 3 X_INDEXES: 3
*******
ROWS_CHANGED_
1 row in set (0.00 sec)
mysql> drop table tu;
Query OK, 0 rows affected (0.01 sec)
mysql> select * from information_ schema. table_statistic s\G ******* ******* ****** 1. row ******* ******* ******* ******
TABLE_ SCHEMA: test
TABLE_ NAME: tu
ROWS_ READ: 0
ROWS_ CHANGED: 3 X_INDEXES: 3
*******
ROWS_CHANGED_
1 row in set (0.00 sec)
mysql>