【已解决】mysql连接出错:ERROR 1040 (HY000): Too many connections
连接mysql,结果出错:
|
1
|
ERROR 1040 (HY000): Too many connections |
去修改mysql的配置文件,然后添加:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
root@bogon:logs# vi /etc/my.cnf[mysqld]lower_case_table_names=1lower_case_table_names=0lower_case_table_names=1datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockmax_connections=100max_user_connections=100# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0# Settings user and group are ignored when systemd is used (fedora >= 15).# If you need to run mysqld under a different user or group,# customize your systemd unit file for mysqld according to the# instructions in http://fedoraproject.org/wiki/Systemduser=mysql# Semisynchronous Replication# uncomment next line on MASTER;plugin-load=rpl_semi_sync_master=semisync_master.so# uncomment next line on SLAVE;plugin-load=rpl_semi_sync_slave=semisync_slave.so# Others options for Semisynchronous Replication;rpl_semi_sync_master_enabled=1;rpl_semi_sync_master_timeout=10;rpl_semi_sync_slave_enabled=1;performance_schema[mysqld_safe]log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pid |
然后重启mysqld:
|
1
2
3
4
|
oot@bogon:logs# service mysqld restartStopping mysqld: [ OK ]Starting mysqld: [ OK ]root@bogon:logs# |
然后重新连接试试,就可以了:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
root@bogon:logs# mysql -u root -p openfire_schoolikeEnter password:Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 440Server version: 5.5.44-cll-lve MySQL Community Server (GPL) by AtomicorpCopyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> |
【总结】
当连接mysql时,出现:
ERROR 1040 (HY000): Too many connections
的错误时:
去增加mysql的最大连接数即可:
修改mysql的配置文件:
/etc/my.cnf
在[mysqld]字段中增加配置:
|
1
2
|
max_connections=100max_user_connections=100 |
当然可以根据自己需要,设置更大的值。
然后再重启mysqld:
|
1
|
service mysqld restart |
即可正常连接mysql。
【已解决】mysql连接出错:ERROR 1040 (HY000): Too many connections的更多相关文章
- 解决MYSQL错误:ERROR 1040 (08004): Too many connections
方法一: show processlist; show variables like 'max_connections'; show global status like 'max_used_conn ...
- Mysql连接数太多ERROR 1040 (HY000): Too many connections
数据库连接报错:ERROR 1040 (HY000): Too many connections 1.查看连接数 /usr/local/mysql/bin/mysqladmin -h host - ...
- 解决MySQL报错ERROR 2002 (HY000)【转】
今天在为新的业务线搭架数据库后,在启动的时候报错 root@qsbilldatahis-db01:/usr/local/mysql/bin# ./mysql ERROR 2002 (HY000): C ...
- mysql 链接数满了的错误 ERROR 1040 (HY000): Too many connections
mysql 链接数满了的错误 ERROR 1040 (HY000): Too many connections 第一种处理方式: ./mysql -u root -p 登录成功后执行以下语句查询当前的 ...
- ERROR 1040 (HY000) Too many connections
C:\Users\Jilil>mysql -u root -pEnter password: *************ERROR 1040 (HY000): Too many connecti ...
- Linux异常关机后,Mysql启动出错ERROR 2002 (HY000)
Linux异常关机后,Mysql启动或訪问时,出错: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/ ...
- 解决MySQL报错ERROR 2002 (HY000)
今天在为新的业务线搭架数据库后,在启动的时候报错 root@qsbilldatahis-db01:/usr/local/mysql/bin# ./mysql ERROR 2002 (HY000): C ...
- mysql连接出错:ERROR 1040 (HY000): Too many connections
1.查看mysql的最大连接数:show variables like '%max_connections%'; 2. 查看服务器响应的最大连接数: 3. 设置最大连接数: set GLOBAL m ...
- 解决Mysql错误:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
需要重启服务器:sudo /etc/init.d/mysql restart
随机推荐
- BUG的严重级别分类 BUG状态标准
英文参考 BUG的严重级别分类 Severity This field describes the impact of a bug. Blocker Blocks development and/or ...
- SpringBoot整合Quartz定时任务 的简单实例 2
(1)什么是Quartz?(2)Quartz的特点:(3)Quartz专用词汇说明:(4)Quartz任务调度基本实现原理: 接下来看下具体的内容: (1)什么是Quartz? Quartz是一个完全 ...
- vue里ref ($refs)用法
ref 有三种用法: 1.ref 加在普通的元素上,用this.ref.name 获取到的是dom元素 2.ref 加在子组件上,用this.ref.name 获取到的是组件实例,可以使用组件的所有方 ...
- Ios之网络编程NSURLConnection
通过NSURLConnection主要通过四个类进行网络访问:NSURL,NSURLRequest,NSMutableURLRequest,NSURLConnection 一.基本知识 (1)NSUR ...
- 文本分类需要CNN?No!fastText完美解决你的需求(后篇)
http://blog.csdn.net/weixin_36604953/article/details/78324834 想必通过前一篇的介绍,各位小主已经对word2vec以及CBOW和Skip- ...
- uboot mmc read/write命令用法
mmc read用来读取mmc内容到内存, mmc write用来写入内存内容到mmc中 具体用法, mmc read <device num> addr blk# cnt [partit ...
- Modbus常用功能码协议详解
Modbus常用功能码协议详解 01H-读线圈状态 1)描述:读从机线圈寄存器,位操作,可读单个或者多个: 2)发送指令: 假设从机地址位0x01,寄存器开始地址0x0023,寄存器结束抵制0x003 ...
- myeclipse集成jdk、tomcat8、maven、svn
今天一个同学要回家了.回家之前叫我帮他配置一下开发环境.然后在家里面自己研究一下.敲下代码. 帮他配置好之后自己回来把这个过程写下来.别让自己把这个东西给忘了. myeclipse安装 myeclip ...
- google protocol buffer 简介 版本 安装 使用 实例
一.简介 protocolbuffer(以下简称PB)是google 的一种数据交换的格式,它独立于语言,独立于平台.google 提供了三种语言的实现:java.c++ 和 python,每一种实现 ...
- Go语言中异常处理painc()和recover()的用法
Go语言中异常处理painc()和recover()的用法 1.Painc用法是:用于抛出错误.Recover()用法是:将Recover()写在defer中,并且在可能发生panic的地方之前,先调 ...