People who have used MySQL know that our MySQL set variable is in the my.cnf file, usually modify the variable once after the MySQL service, but in the actual production server This is not allowed, we can use this statement to query all the MySQL variables
Mysql> show global variables;
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/86/8D/wKiom1fDzN_BrRKqAAExUMuDkpU932.png-wh_500x0-wm_3 -wmp_4-s_2972438836.png "title=" show Global Variables.png "alt=" Wkiom1fdzn_brrkqaaexumudkpu932.png-wh_50 "/>
If slow query log analysis is turned on in MySQL, check the default time for slow query and adjust the default time
mysql> show global variables like "%_time"; + ------------------------+----------+| variable_name | value |+------------------------+----------+| flush_time | 0 | | innodb_old_blocks_time | 0 | | long_query_time | 1.000000 | | slow_launch_time | 2 | +------------------------+----------+4 rows in set (0.00 sec) MySQL > set global long_query_time=2; query ok, 0 rows affected (0.00 sec)
In this session the variable will not take effect after the need to exit after the entry to view the MySQL variable to take effect, modified to remember to modify the my.cnf file so that MySQL after restarting the value of the variable is not changed, it is important to note that the use of set Global setting the value of the MySQL variable needs to be in the configuration of the [mysqld] stack in the my.cnf file to write down this variable, or MySQL will be restarted
This article from the "Technical essay" blog, reproduced please contact the author!
MySQL variable modification and effective