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
Page domain relationship: The main page a.html bel...
Recently, a new requirement "front-end cache...
<meta name="viewport" content="...
Recently, when upgrading the Zabbix database from...
This article shares with you how to install the M...
Portainer Introduction Portainer is a graphical m...
Mysql5.5 dual machine hot standby Implementation ...
This article mainly introduces how to build a MyS...
Table of contents Use Cases Reactive API related ...
Table of contents 1. Introduction 2. Rendering 3....
Table of contents 1. Usage 1. Basic usage 2. The ...
Table of contents Preface Architecture at a Glanc...
1. Query process show processlist 2. Query the co...
Table of contents 1. Browser support 2. export ex...
The figure below shows the browser viewing rate i...