Mysql 1135 error Solution

Source: Internet
Author: User

The error message of mysql 1135 is as follows:

SQLSTATE [HY000] [1135] Can't create a new thread (errno 12); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug

Solution:

Modify my. ini and add two parameters:

Innodb_thread_sleep_delay = 40

Wait_timeout = 100

Interactive_timeout = 100

Restart the MYSQL server

The problem above is that there are too many threads:

1. Too many connections

2. the lifecycle allowed by each thread is too long, just like the http timeout.

In LINUX, you can check the number of connections as follows:

Ps-aux | grep mysql

[Supplemental knowledge] ========================================

Configuration parameters interactive_timeout and wait_timeout in MySQL

(1) interactive_timeout:

Parameter description: The number of seconds before the server closes the interactive connection. Interactive clients are defined as clients that use the CLIENT_INTERACTIVE option in mysql_real_connect.

Default Value of the parameter: 28800 seconds (8 hours)

(2) wait_timeout:

Parameter description: The number of seconds waiting for activity before the server closes a non-interactive connection.

When a thread starts, the wait_timeout value of the session is initialized based on the global wait_timeout value or the global interactive_timeout value, depending on the client type (defined by the CLIENT_INTERACTIVE connection option of mysql_real_connect ).

Default Value of the parameter: 28800 seconds (8 hours)

The maximum number of connections supported by the MySQL Server is limited, because the creation of each connection consumes memory. Therefore, we want the client to complete the corresponding operations after connecting to the MySQL Server, disconnect and release the occupied memory. If your MySQL Server has a large number of idle connections, they will not only consume the memory in vain, but if the connections continue to accumulate and continue to open, it will eventually reach the maximum number of connections of the MySQL Server, this will report the 'too has connections' error. The value of wait_timeout should be determined based on the system running condition. After the system runs for a period of time, you can run the show processlist command to view the connection status of the current system. If a large number of connection processes in sleep status are found, this parameter is set too large, you can make some adjustments.

Problem:

If you only set the parameter wait_timeout = 100 in the configuration file my. cnf, restart the server and run the following command:

Mysql> show variables like "% timeout % ";

The parameter setting is still 28800 (8 hours by default ).

After querying data, you must set interactive_timeout and wait_timeout at the same time.

[Mysqld]

Wait_timeout = 100

Interactive_timeout = 100

After the MySQL Server is restarted, check that the settings have taken effect.

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.