Set mysql to not automatically submit after startup

Source: Internet
Author: User

This is actually a simple question. Many blogs and forums on the Internet have relevant answers. These answers are good, but they forget to indicate a small detail. This small detail also plagued me for one night. Later, I checked the relevant information to find out the details.

Start with setting non-automatic submission: You can add the following statement to the configuration file my. ini:

[Mysqld]
Init_connect = 'set autocommit = 0'


Then restart the service. Last night, after following this configuration, I restarted the service and logged on to mysql. Type: show variables like 'autocommit'

The following result is displayed:

Autocommit ON

This shows that the statements I add to the configuration file have no effect. I finally checked the Chinese help document of mysql 5.1. I found that after init_connect, login with Super users is not loaded. This is mysql's consideration for security reasons. Then I switch to "normal user" and log on, and type: show variables like 'autocommit'

The following result is displayed:

Autocommit OFF

This problem was solved successfully.


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.