In the MySQL documentation, MySQL variables can be divided into two categories, namely system variables and user variables. However, according to actual applications, they are further divided into four types, namely local variables, user variables, session variables and global variables. 1. Local variables MySQL local variables can only be used in begin/end statement blocks, such as begin/end statement blocks in stored procedures. Its scope is limited to this statement block.
2. User variables MySQL user variables. User variables in MySQL do not need to be declared in advance. When using them, just use "@variable name" directly. Its scope is the current connection.
Session variables MySQL session variables, the server maintains a series of session variables for each connected client. Its scope is limited to the current connection, that is, the session variables in each connection are independent.
4. Global variables MySQL global variables, global variables affect the overall operation of the server, when the service starts, it initializes all global variables to default values. To modify global variables, you must have super privileges. Its scope is the entire life cycle of the server.
The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Vue3.0 implements encapsulation of checkbox components
>>: Solve the problem of IDEA configuring tomcat startup error
Table of contents getApp() Define variables at th...
Error message: Job for mysqld.service failed beca...
Simple description Since it was built with Centos...
When installing mha4mysql, the steps are roughly:...
Preface Sometimes when we view database data, we ...
This article introduces Nginx from compilation an...
Table of contents 1. Keywords 2. Deconstruction 3...
Mine is: <!DOCTYPE html> Blog Garden: <!...
Table of contents utils: Use in vue: explain: Ima...
Not using lazy loading import Vue from 'vue...
1. Download the software 1. Go to the MySQL offic...
Table of contents 1. Basic theory 1.1 Transaction...
Scrcpy Installation snap install scrcpy adb servi...
Or write down the installation process yourself! ...
Table of contents 1. Basic principles 2. Specific...