Get the App
SLTechnology News&Howtos  ›  Database  › 

How MySQL sets system variables

Shulou Source: shulou.com Published: 2022-06-01 19:55:47 10月03日 Update

This article mainly introduces MySQL how to set system variables, the content of the article is carefully selected and edited by the author, with a certain pertinence, for everyone's reference significance is still relatively great, the following with the author to understand the next topic content.

System variables are divided into global variables and session variables. Global variables will affect the entire CVM. Session variables, on the other hand, only affect the current session (that is, the current database connection)

1 output global variables:

Mysql > show global variables

View a global variable:

Mysql > show global variables like "version"

+-+ +

| | Variable_name | Value |

+-+ +

| | version | 5.6.30 | |

+-+ +

Set the global variable:

Mysql > set global general_log=on; # permanent change, need to modify the configuration file

Query OK, 0 rows affected (0.35 sec)

2 output session variables:

Mysql > show variables; or

Mysql > show session variables

Set the session variable:

Mysql > set wait_timeout=1000

Query OK, 0 rows affected (0.00 sec)

After reading the above about how to set system variables in MySQL, many readers must have some understanding. If you need to get more industry knowledge and information, you can continue to follow our industry information column.

Tags: Variables global system content author industry influence output subject information meaning data database file article more friends server column knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info OPPO Reno NVidia Linux Xiaomi