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.