Is the correct modification scheme for the maximum number of connections in MySQL

Source: Internet
Author: User

The following article describes how to modify the maximum number of connections of MySQL. We all know that the default value of the maximum number of connections of MySQL is 100, this value is far from enough for applications that concurrently connect to many databases. When the connection request exceeds the default number of connections, the database cannot be connected, so we need to increase it.

The adjustment method is as follows:

1. in linux Server: change the value in my. cnf.

2. Windows server I used ):

Find the [MySQLd] segment in the file "my. ini" and add a line to it.

Max_connections = 200 ### 200 can be changed to the value you want to set.

Then restart the MySQL service.

/MySQLadmin path/MySQLadmin-uroot-p variables

Enter the password of the root database account.

| Max_connections | 1000 |

Other notes:

During programming, a temporary variable is made before each statement is executed to open the database when you use a MySQL statement to call the database, remember to close the MySQL temporary variable after each call.

Else... 100. txt. When necessary, analyze the data in all text files and import the data to the database.

The above content describes how to modify the maximum number of connections of MySQL. I hope you will get some benefits.

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.