Article Directory
- From the scope of either global session and
- From the type of modifications and may be divided into read-only parameter
- Users can modify the read-only non-parametric online
- Read-only parameters can only be changed through the configuration file and restart
- Modify all the parameters are not persistent
View parameters
View all parameters in MySQL, MySQL is no implicit argument:
mysql> show variables;
View a parameter, certain parameters, you can use wildcards as follows:
mysql> show variables like 'innodb%';
Change parameters
mysql> set slow_query_log = off;
ERROR 1229 (HY000): Variable 'slow_query_log' is a GLOBAL variable and should be set with SET GLOBAL
Modify global level variables: the current session does not take effect for subsequent sessions connections come into force
mysql> set global slow_query_log = off;
Query OK, 0 rows affected (0.00 sec)
Modify the session-level variables
mysql> set session slow_query_log = off;
Query OK, 0 rows affected (0.00 sec)
Save parameters
Although MySQL parameters can be modified through the set command, but not permanent preservation, we need to manually modify the configuration file before they can persist
vi /etc/my.cnf