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:
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.