Mysql学习mysql too many open connections问题解决方法

MysqL学习MysqL too many open connections问题解决方法》要点:
本文介绍了MysqL学习MysqL too many open connections问题解决方法,希望对您有用。如果有疑问,可以联系我们。

曾经以为在my.cnf写入max_connections = 2000
就可以改变MysqL的最大并发量,本日查到一个命令,发现服务器的MysqL最大连接数为151.MysqL数据库

控制台,连接上MysqL
MysqL数据库

代码如下:

show variables;

这条命令可以看到所有基础配置

如果单独看max_connections可以这样
MysqL数据库

代码如下:

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 好像是lampp认的最大连接数.

my.cnf里大致这样写的
MysqL数据库

代码如下:

max_connections=2000
# The MysqL server
[MysqLd]
port            = 3306
socket          = /Applications/XAMPP/xamppfiles/var/MysqL/MysqL.sock

改完以后
代码如下:

# The MysqL server
[MysqLd]
max_connections=2000
port            = 3306

然后把max_connections=2000移动到[MysqLd]下面,重启动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

就好了.MysqL数据库

说明这配置必需在[MysqLd]下面,才有用.MysqL数据库

欢迎参与《MysqL学习MysqL too many open connections问题解决方法》讨论,分享您的想法,编程之家PHP学院为您提供专业教程。

相关文章

优化MySQL数据库发布系统存储的方法有:1.mysql库主从读写分...
使用mysql的方法:在“我的电脑”→右键→“管理”→“服务”...
在mysql中查看root用户权限的方法:1.命令行启动mysql服务;...
MySQL主从复制是用来备份一个与主数据库一样环境的从数据库,...
运行mysql的方法1.启动mysql服务,在“我的电脑”→右键→“...
开启mysql的方法1.可以通过快捷键win+r,输入cmd,打开窗口,...