【已解决】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
随机推荐
- webGl中实现clipplane
webGl中实现clipplane 参考:调用glClipPlane()函数所执行的裁剪是在视觉坐标中完成的,而不是在裁剪坐标中进行的https://blog.csdn.net/shengwenj/a ...
- [leetcode]Spiral Matrix @ Python
原题地址:https://oj.leetcode.com/problems/spiral-matrix/ 题意: Given a matrix of m x n elements (m rows, n ...
- 如何mount一个Isilon的NFS的file share?
命令如下: mount -o vers=3,proto=tcp 172.16.200.41:/ifs/nfsshare1 /mnt/localfolder1 简单版的 mount 192.168.1. ...
- CSS-图片不变形设置
不管网页做的美还是丑,有一个问题始终是无法躲避的,就是有的时候会遇到图片变形的问题,之前遇到过这种问题解决过,不过还是整体的重新研究了一下图片,其中主要涉及到的知识点就是max-width和max-h ...
- SharePoint CAML Query小结
CAML的结构. <View Type="HTML" Name="Summary"> <ViewBody ExpandXML="TR ...
- [Spring boot] Autowired by name, by @Primary or by @Qualifier
In the example we have currently: @Component public class BinarySearchImpl { @Autowired private Sort ...
- android学习四(Activity的生命周期)
要学好活动(Activity).就必需要了解android中Activity的声明周期.灵活的使用生命周期.能够开发出更好的程序,在android中是使用任务来管理活动的,一个任务就是一组存放在栈里的 ...
- BAT,你好!字幕组,再见!——也许要跟美剧说再见了~
对于美剧迷来说,上周的星期六(2014 年11 月 22 日)是黑色的一天. 11 月 22 日,人人影视暂时关站,并发布公告称网站正在清理内容.虽然这不是人人影视第一次关站清理,而且人人影视还给出提 ...
- 修改linux的时间可以使用date指令
修改linux的时间可以使用date指令 修改日期: 时间设定成2009年5月10日的命令如下: #date -s 05/10/2009 修改时间: 将系统时间设定成上午10点18分0秒的命令如下. ...
- GB2312码表
GB2312码表 code +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F A1A0 . . · ˉ ˇ ¨ " 々 — - | … ‘ ’ ...