MySQL too many open connections problem solving method _mysql

Source: Internet
Author: User

Ever thought in my.cnf write max_connections = 2000
You can change the maximum concurrency of MySQL, a command today, found that the server's MySQL maximum number of connections to 151.

console, connecting to MySQL

Copy Code code as follows:

Show variables;

This command can see all the underlying configurations

If you look alone, max_connections can do this.

Copy Code code as follows:

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 LAMPP default maximum number of connections.

That's what My.cnf wrote in general.

Copy Code code as follows:

max_connections=2000
# The MySQL server
[Mysqld]
Port = 3306
Socket =/applications/xampp/xamppfiles/var/mysql/mysql.sock

After the change is done
Copy Code code as follows:

# The MySQL server
[Mysqld]
max_connections=2000
Port = 3306

Then move the max_connections=2000 under [mysqld] and restart MySQL
Copy Code code as follows:

+ —————————-+ ———— +
| 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

Just fine.

Note that this configuration must be under [mysqld] for use.

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.