1. There are two ways to modify global variables in MySQL: Method 1: Modify the my.ini configuration file. If you want to set global variables, the easiest way is to write the variable configuration directly in the my.ini file, as shown in the figure below. Restarting the database service will make the global variables take effect. We open several MySQL command lines and can see that the variables in all sessions are effective, as shown in the figure Method 2: Use the keyword global to set global variables without modifying the configuration file Set the value of the autocommit variable to ON It should be noted that the setting of global variables using this method is only valid for newly opened sessions and is not effective for already opened sessions. 2. To modify session variables in MySQL, you can use the session keyword, such as: Modifying the session variable configuration is only effective for the variable configuration of this session and is invalid for other sessions. 3. Although global variables and session variables are set, the database configuration will be reinitialized after the MySQL service is restarted, and everything will be initialized according to the configuration of my.ini. Both global and session configurations will become invalid. Summarize The above is the method of setting global variables and session variables in MySQL that I introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Nginx load balancing algorithm and failover analysis
>>: Basic usage examples of Vue named slots
The elements in an HTML document are arranged one...
Preface This article is quite detailed and even a...
The connection method in MySQL table is actually ...
Preface There are 4 types of operators in MySQL, ...
Table of contents Brief summary At noon today, th...
HTML is made up of tags and attributes, which are...
After the changes: innodb_buffer_pool_size=576M -...
The solution to forgetting the initial password o...
Get ip tool import lombok.extern.slf4j.Slf4j; imp...
1. What is Vue Vue is a progressive framework for...
This article example shares the specific code for...
Prerequisites A cloud server (centOS of Alibaba C...
VNC is a remote desktop protocol. Follow the inst...
This article shares the installation tutorial of ...
Table of contents 1. Build the operating environm...