Take you to understand mysql Variables

Source: Internet
Author: User

Mysql variables are the basic knowledge of the mysql database. The following describes mysql variables in detail. If you are interested in this aspect, you may wish to take a look and I believe it will help you.

Mysql variables:

The system variable of the mysql server, mysql server system viriables, I prefer to call it "system parameter ".

The mysql Server maintains two mysql system parameter system variables: global variables and session variables ). Their meanings and differences are shown in their respective names. session variables are at the session level, and changes to them only affect the current session; global variables are system-level, the changes will affect all new sessions, but the existing sessions will not be affected) until the next mysql server restarts. Note that the change impact cannot be different from the restart. To use the new value when mysql server is restarted, you must specify the variable option or change the option file on the command line, however, the cross-Restart mode cannot be implemented through the SET change. Each system variable has a default value, which is determined when the mysql system is compiled. System variables can be specified in the command line or in the option file when the server is started. Of course, most system variables can be specified during system running, use the set command to specify its value.

User-level mysql variables:

You can save a value in your mysql variable and then reference it later. In this way, you can pass the value from one statement to another. User variables are related to connections. That is to say, variables defined by one client cannot be viewed or used by other clients. When the client exits, all variables connected to the client are automatically released. The user variable is in the form of @ var_name, where the variable name var_name can be composed of the Current Character Set's literal numeric characters, '.', '_', and '$. The default character set is cp1252 (Latin1 ). You can use the -- default-character-set Option of mysqld to change the character set. See section 5.10.1 "Character Set for data and sorting ". User variable names are case-insensitive. One way to SET user variables is to execute the SET statement: SET @ var_name and so on.

Provides you with an in-depth understanding of MySQL user connection

Solution to querying garbled characters in MySQL

How to query time periods in MySql

How to optimize MySQL query using the Limit parameter

Use MySQL temporary tables to accelerate queries

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.