Workaround for MySQL 1040 error too many connections

Source: Internet
Author: User

Workaround for MySQL 1040 error too many connections

1. May be the problem with MySQL max connections setup

2. It is possible that multiple insert,update operations have not closed the session and need to configure transaction support in spring.

Solve:

1. Change the time-out time of the session in Tomcat to 20, (not required)

2. Transaction support for operations with large processing volumes for database insert or update.

=======================================

The following are the workarounds:

Com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:Data Source rejected establishment of Connection, message from server: "Too many connections"

Reason: www.2cto.com

Because the number of concurrent connections set in the My.ini in your MySQL installation directory is too low or the system is busy causing the number of connections to be full

How to resolve:

Open MySQL install directory open My.ini find Max_connections (in about line 93rd) default is 1001 like set to 500~1000 more appropriate, restart MySQL, so 1040 error is solved.

max_connections=1000

Be sure to restart MySQL to take effect

Cmd->

net stop MySQL

net start MySQL

Questions about the inability to start MySQL after changing innodb_log_file_size

Www.2cto.com

Innodb_buffer_pool_size=768m

innodb_log_file_size=256m

Innodb_log_buffer_size=8m

innodb_additional_mem_pool_size=4m

Innodb_flush_log_at_trx_commit=0

Innodb_thread_concurrency=20

The above is the initial optimization of the InnoDB engine, found that the update innodb_log_file_size=256m when there is a problem, as long as the addition of this will not start,

Later only to know the original to stop the service first, and then delete the original file ...

Open/mysql Server 5.5/data

Delete Ib_logfile0, Ib_logfile1........ib_logfilen

Turn on the option again to start successfully.


Workaround for MySQL 1040 error too many connections

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.