`
qepwqnp
  • 浏览: 105850 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Mysql ERROR 1040 (00000): Too many connections

 
阅读更多

 

程序添加数据库数据:
错误信息: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"


Navicat连接数据库报错
错误信息: 1040 Too many connections


重启Mysql :: mysql restart
错误信息:mysql ERROR 1040 (00000): Too many connections


当出现如下情况的时候,避免用户收到影响,先重启下Mysql[root@localhost ~]# service mysqld restart


[root@localhost ~]# mysql
mysql> select @@global.max_connections;
+--------------------------------------+
| @@global.max_connections |
+--------------------------------------+
| 100 | 
+--------------------------------------+

 

 

 

// 也就是说现在的最大连接数是 100,我们把他修改为500,。
mysql> set global max_connections=500; 
Query OK, 0 rows affected (0.00 sec)

 

 

 

分享到:
评论

相关推荐

    解决mysql 1040错误Too many connections的方法

    mysql官方告诉我们需要修改max_connections的值,那么我们怎么去修改呢?有两种方法 1、修改配置文件文件 修改/etc/my.cnf这个文件,在[mysqld]中新增max_connections=N,如果你没有这个文件请从编译源码中的support...

    mysql连接数设置操作方法(Too many connections)

    ERROR 1040 (08004): Too many connections 解决办法,这也是centos7下修改mysql连接数的做法: 1)临时修改 MariaDB [(none)]> show variables like “max_connections”; +—————–+——-+ | Variable_name ...

    MySQL性能优化方向

     经常会遇见”mysql: error 1040: too many connections”的情况,一种是访问量确实很高,mysql服务器抗不住,这个时候要考虑增加从服务器分散读压力,另外一种情况是mysql配置文件中max_connections值过小: ...

    mysql too many connections 错误 之 mysql解决方法

    解决方法是修改/etc/mysql/my.cnf,添加... 以下是mysql.com网站的相关说明: If you get a Too many connections error when you try to connect to the mysqld server, this means that all available connections are

    Mysql 错误too many connections解决方案

    Mysql 错误提示too many connections,最近遇到这个错误,经过上网查资料解决了,这里记录下,帮助有需要的朋友, 解决方法是修改/etc/mysql/my.cnf,添加以下一行: set-variable = max_connections=500 或在启动命令...

    mysql优化连接数防止访问量过高的方法

    很多开发人员都会遇见”MySQL: ERROR 1040: Too many connections”的异常情况,造成这种情况的一种原因是访问量过高,MySQL服务器抗不住,这个时候就要考虑增加从服务器分散读压力;另一种原因就是MySQL配置文件中...

    b03703023_blog

    服务器有时会因ER_CON_COUNT_ERROR: Too many connections崩溃ER_CON_COUNT_ERROR: Too many connections错误 托多斯 我尚未添加任何警报(例如输入错误密码等情况)。 具有相同的用户或帖子时,缺少身份验证。 ...

    MySQL 配置优化(多个参数)

    下面列出了对性能优化影响较大的主要变量,主要分为连接请求的变量和缓冲区变量。...数值过小会经常出现ERROR 1040: Too many connections错误,可以过’conn%’通配符查看当前状态的连接数量,以定夺该值的大

    记一次MySQL数据库问题排查

     错误日志中看到频繁有这样的一个异常报错:Error: ER_CON_COUNT_ERROR: Too many connections。这个报错是因为数据库的所有连接被客户端都占有了,没有空闲的连接可以使用。MySQL 默认的大并发连接数是 100,然而...

    mysql数据库my.cnf配置文件

    log-error=/home/mysql/log/mysqld.log pid-file =/home/mysql/mysqld.pid bind-address = 0.0.0.0 server-id = 1 #表示是本机的序号为1,一般来讲就是master的意思 skip-grant-tables skip-name-resolve # 禁止MySQL...

    php.ini-development

    error_reporting ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED ; Development Value: E_ALL ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT ; html_errors ; Default Value: On ; ...

Global site tag (gtag.js) - Google Analytics