Is it normal, that the MySQL global variable gtid_executed changes multiple times in a minute?
These MySQL commands were executed in a time range of 10 seconds:
mysql> show global variables like 'gtid_executed';
+---------------+-------------------------------------------------+
| Variable_name | Value |
+---------------+-------------------------------------------------+
| gtid_executed | d4eeed2f-6cc7-11e9-aa15-fa163e5318c7:1-26918205 |
+---------------+-------------------------------------------------+
1 row in set (0.00 sec)
mysql> show global variables like 'gtid_executed';
+---------------+-------------------------------------------------+
| Variable_name | Value |
+---------------+-------------------------------------------------+
| gtid_executed | d4eeed2f-6cc7-11e9-aa15-fa163e5318c7:1-26918206 |
+---------------+-------------------------------------------------+
1 row in set (0.00 sec)
mysql> show global variables like 'gtid_executed';
+---------------+-------------------------------------------------+
| Variable_name | Value |
+---------------+-------------------------------------------------+
| gtid_executed | d4eeed2f-6cc7-11e9-aa15-fa163e5318c7:1-26918207 |
+---------------+-------------------------------------------------+
1 row in set (0.00 sec)
Every time there is a different value! Is that normal?
It is a single node SaaS MySQL RDS instance in a cloud environment.
Thank you kindly in advance.
If you have activity on the server this is a normal behaviour, as for each new transaction a new GTID value is assigned to it incremented by one.
Related
My team is getting this below error message on AWS Cluster Aurora RDS on reader and writer instances:
Waiting for table level lock
Kindly note:
We are NOT USING Lock Tables explicitly anywhere
We are NOT USING MyISAM Tables
We are NOT USING any Kind of MYSQL Dump
.
mysql> show variables like '%innodb_table%';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| innodb_table_locks | ON |
+--------------------+-------+
1 row in set (0.00 sec)
mysql> show variables like '%innodb_autoinc_lock_mode%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| innodb_autoinc_lock_mode | 1 |
+--------------------------+-------+
1 row in set (0.00 sec)
For those who know about this issue - Is there anyway we can replicate the issue on our Testing Node.
I'm using MySQL 5.7.25 and i want to increase my MySQL password policy by doing this in MySQL command:
SET GLOBAL validate_password_policy=2;
But i always get an error:
ERROR 1193 (HY000): Unknown system variable 'validate_password_policy'
I tried to list the validate_password variable:
SHOW VARIABLES LIKE 'validate_password%'
but it always return empty set
This problem has happened because validate_password plugin is by default NOT activated. You can solve by these commands:
mysql> select plugin_name, plugin_status from information_schema.plugins where plugin_name like 'validate%';
Empty set (0.00 sec)
mysql> install plugin validate_password soname 'validate_password.so';
Query OK, 0 rows affected (0.02 sec)
mysql> select plugin_name, plugin_status from information_schema.plugins where plugin_name like 'validate%';
Finally, you will show the following:
+-------------------+---------------+
| plugin_name | plugin_status |
+-------------------+---------------+
| validate_password | ACTIVE |
+-------------------+---------------+
1 row in set (0.00 sec)
Then you can run your command:
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | 8 |
| validate_password_mixed_case_count | 1 |
| validate_password_number_count | 1 |
| validate_password_policy | MEDIUM |
| validate_password_special_char_count | 1 |
+--------------------------------------+--------+
7 rows in set (0.00 sec).
This command works for me. I'm using MySQL 8.
SET GLOBAL validate_password.policy=LOW;
SET GLOBAL validate_password_policy=LOW;
Replace validate_password(dot)policy with validate_password_policy
I have done a GTID replication in MySQL 5.7.18, I have setup the fail over both master and slave health is good. When I am trying to down master I am getting this error.
Failover starting in 'auto' mode...
2017-05-29 14:53:56 PM CRITICAL The server IP :3306 does not comply to the latest GTID feature support. Errors:
Missing gtid_executed system variable.
So I googled, they were telling to check global variable and variable which I don't understand. This is my master status of gtid_exe
mysql> show variables like '%**gtid_exe%'**;
+----------------------------------+-------+
| Variable_name | Value |
+----------------------------------+-------+
| gtid_executed_compression_period | 1000 |
+----------------------------------+-------+
1 row in set (0.00 sec)
mysql> show global variables like '%**gtid_exe%**';
+----------------------------------+-------------------------------------------------+
| Variable_name | Value |
+----------------------------------+-------------------------------------------------+
| **gtid_executed** | c6b90b56-4084-11e7-8af7-00163e4da2ba:1-26006378 |
| gtid_executed_compression_period | 1000 |
+----------------------------------+-------------------------------------------------+
2 rows in set (0.01 sec)
For testing, I almost rebuild the newly designed MySQL database every day recently, I also have a Php application based on that. For my understanding, some of system variables value has been accumulated in every rebuild, such as:
mysql> show global status like '%tmp%';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| Created_tmp_disk_tables | 14062 |
| Created_tmp_files | 437 |
| Created_tmp_tables | 20854 |
+-------------------------+-------+
3 rows in set (0.00 sec)
Created_tmp_disk_tables and Created_tmp_tables are growing constantly based on every rebuild. Surely there are some other variables doing same thing. I wonder how can we clean them safely in every rebuild, so we won't be cheated by these values. We will see the real value.
Please feel free to let me know if the question is not clear. Thanks.
after testing #dwjv's suggestion, doing 'flush status', got:
mysql> flush status;
Query OK, 0 rows affected (0.02 sec)
mysql> show global status like '%tmp%';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| Created_tmp_disk_tables | 14062 |
| Created_tmp_files | 0 |
| Created_tmp_tables | 20856 |
+-------------------------+-------+
3 rows in set (0.00 sec)
The variable 'Created_tmp_files' was cleaned, but other two didn't change.
'Flush status' will only reset the session status, some, but not all the global status variables.
mysql> show status like '%tmp%';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| Created_tmp_disk_tables | 0 |
| Created_tmp_files | 0 |
| Created_tmp_tables | 0 |
+-------------------------+-------+
3 rows in set (0.00 sec)
Then I followd &Yak's suggestion 'service mysql restart', got:
mysql> show global status like '%tmp%';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| Created_tmp_disk_tables | 14062 |
| Created_tmp_files | 0 |
| Created_tmp_tables | 20857 |
+-------------------------+-------+
3 rows in set (0.00 sec)
Still same, no change.
All you need to do is restart the server.
FLUSH STATUS;
This will flush many of the global variables.
I would like to know the difference between below two values in mysql.
show status like 'queries' ;
+---------------+-------------+
| Variable_name | Value |
+---------------+-------------+
| Queries | 16987383643 |
+---------------+-------------+
1 row in set (0.00 sec)
mysql> show status like 'Questions' ;
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Questions | 5 |
+---------------+-------+
1 row in set (0.00 sec)
Try looking in the manual?
13.7.5.37. SHOW STATUS Syntax
5.1.5. Server Status Variables
unlike the Queries variable. This [Questions] variable does not count COM_PING, COM_STATISTICS, COM_STMT_PREPARE, COM_STMT_CLOSE, or COM_STMT_RESET commands.