MySQL basic--global parameters and session parameters settings

Source: Internet
Author: User

1. Modify the My.ini configuration file, if the simplest way to set a global parameter is to write the parameter configuration directly in the My.ini file, as shown in. Restarting the database service enables the global parameters to take effect.

As shown, all the parameters in the new session are in effect.

2. On the basis of not modifying the configuration file, set global parameters, set globally autocommit=1; Sets the value of the autocommit parameter to ON

The parameters in the other session window are not in effect

It can be seen that the global parameters are set, but the autocommit parameters that have been queried have not changed. Did we fail to set it up? No, you need to reopen a session window to be a global parameter.

As shown in the newly opened window, the display parameter settings are already in effect. so the global parameter setting is not valid for the session that is already open, but it is effective for the newly opened session.

3. Modify the session parameter configuration, set session autocommit=1, only the parameter configuration for this session is valid, for the other session is not valid.

The configuration of the other session is not in effect, as shown in

4. Although the global variables are set, after the MySQL service restarts, the configuration of the database is reinitialized, and everything is initialized according to the My.ini configuration. Both the global and session configurations will fail.

MySQL basic--global parameters and session parameters settings

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.