Share: how to solve the problem related to mysql too connector open connections

Source: Internet
Author: User

How to solve the problem of mysql too connector open connections.
Reference: http://www.jbxue.com/db/10068.html

The main cause is that the configuration of max_connections is incorrect. It takes effect only under [mysqld.

I used to think that writing max_connections = 2000 in my. cnf
You can change the maximum concurrency of mysql. Today, a command is found to show that the maximum number of mysql connections on the server is 151.
Console, connect to mysql
Show variables;

This command shows all the basic configurations.
If you read max_connections separately

show variables like 'max%';+—————————-+————+| Variable_name | Value |+—————————-+————+| max_allowed_packet | 1048576 || max_binlog_cache_size | 4294963200 || max_binlog_size | 1073741824 || max_connect_errors | 10 || max_connections | 151 || max_delayed_threads | 20 || max_error_count | 64 || max_heap_table_size | 16777216 || max_insert_delayed_threads | 20

151 seems to be the default maximum number of connections of lampp.

This is roughly written in my. cnf.

max_connections=2000# The MySQL server[mysqld]port = 3306socket = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock

After modification

# The MySQL server[mysqld]max_connections=2000port = 3306

Next, move max_connections = 2000 to [mysqld] and restart mysql.

+—————————-+————+| Variable_name | Value |+—————————-+————+| max_allowed_packet | 1048576 || max_binlog_cache_size | 4294963200 || max_binlog_size | 1073741824 || max_connect_errors | 10 || max_connections | 2000 || max_delayed_threads | 20 || max_error_count | 64 || max_heap_table_size | 16777216 || max_insert_delayed_threads | 20

You can.

This configuration must be available under [mysqld.

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.