ERROR 1040 (08004): Too many connections
ERROR 1040 (08004): Too many connections
长期一来,mysql低版本中,当面对连接数陡增而出现too many connections时,往往比较棘手。今天特意在mysql社版本的8.0.17中,操作试验并记录下了。以前percona版本中就有该功能了。以后再也不用重启服务了。
mysql> show variables like '%max_conn%';
+------------------------+---------+
| Variable_name | Value |
+------------------------+---------+
| max_connect_errors | 1000000 |
| max_connections | 1024 |
| mysqlx_max_connections | 100 |
+------------------------+---------+
3 rows in set (0.00 sec) mysql> set global max_connections=2;
Query OK, 0 rows affected (0.00 sec)
# 管理端口
mysql> show variables like '%port%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| admin_port | 33062 |
| large_files_support | ON |
| mysqlx_port | 33060 |
| mysqlx_port_open_timeout | 0 |
| port | 3306 |
| report_host | |
| report_password | |
| report_port | 3306 |
| report_user | |
| require_secure_transport | OFF |
+--------------------------+-------+
10 rows in set (0.02 sec)
注意:admin_port该参数不需要明确指定,你的mysql端口是3306的话,这里就显示33062.
# 打开第一个连接
[root@fudao_db_cluster_001 ~]# mysql -utest_r -h 10.192.30.53 -p'f9p%VSfXxcY3kHLJmKIi'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 26
Server version: 8.0.17 MySQL Community Server - GPL Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
# 打开第二个连接
[root@fudao_db_cluster_001 local]# mysql -utest_r -h 10.192.30.53 -p'f9p%VSfXxcY3kHLJmKIi'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 27
Server version: 8.0.17 MySQL Community Server - GPL Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
# 打开第三个连接
[root@fudao_db_cluster_001 local]# mysql -utest_r -h 10.192.30.53 -p'f9p%VSfXxcY3kHLJmKIi'
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1040 (08004): Too many connections
[root@fudao_db_cluster_001 local]#
# 用管理端口本地登录
[root@fudao_db_cluster_001 local]# mysql -h 127.0.0.1 -uadmin_m -p'rA75MQy*R*y@KO4z%LZe' -P 33062
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 29
Server version: 8.0.17 MySQL Community Server - GPL Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
从上面可以看出,当普通用户连接数满后,只能用超级用户本地127.0.0.1或者localhost登录。
[root@fudao_db_cluster_001 local]# mysql -h 10.192.30.53 -uadmin_m -p'rA75MQy*R*y@KO4z%LZe' -P 33062
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on '10.192.30.53' (111)
[root@fudao_db_cluster_001 local]#
ERROR 1040 (08004): 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 1040 (HY000): Too many connections
连接mysql,结果出错: ? 1 ERROR 1040 (HY000): Too many connections 去修改mysql的配置文件,然后添加: ? 1 2 3 4 5 6 7 8 9 1 ...
- 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 ...
- mysql连接出错:ERROR 1040 (HY000): Too many connections
1.查看mysql的最大连接数:show variables like '%max_connections%'; 2. 查看服务器响应的最大连接数: 3. 设置最大连接数: set GLOBAL m ...
- MySQL ERROR 1040: Too many connections
如题,本章主要讲下当服务器出现 ERROR 1040: Too many connections错误时的一些处理心得. max_connections查看 ## 查看最大连接数 SHOW VARIAB ...
- 打开mysql时,提示 1040,Too many connections
打开mysql时,提示 1040,Too many connections,这样就无法打开数据库,看不了表里边的内容了. 出现这个问题的原因是,同时对数据库的连接数过大,mysql默认的最大连接数是1 ...
- openstack中数据库连接数太多--pymysql.err.OperationalError,1040, u'Too many connections'
1.出现问题: openstack运行过程中出现如下问题: OperationalError: (pymysql.err.OperationalError) (1040, u'Too many con ...
随机推荐
- 取长文本 READ_TEXT
****取长文本 FORM GET_TEXT USING TDID TDNAME. SELECT SINGLE mandt tdobject tdname tdid tdspras INTO ...
- jQuery 获得内容
地址 text() - 设置或返回所选元素的文本内容 html() - 设置或返回所选元素的内容(包括 HTML 标记) val() - 设置或返回表单字段的值 一.text() html() &l ...
- 【HANA系列】SAP Vora(SAP HANA和Hadoop)简析
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[HANA系列]SAP Vora(SAP HAN ...
- HCL 试验1
PC端配置:配置ip地址 交换机配置:①创建VLAN system-view vlan 10 vlan 20 ②配置PC端接口 interface gi 1/0/1 port link-type ac ...
- win10电脑休眠后无法唤醒的解决办法
电脑的休眠功能,为长时间不用的电脑进行了关闭显示.硬盘停转的深度节能模式,不仅节约能源,还保护设备. 但有些时候也会出现一些问题,如休眠后无法唤醒,无法移动鼠标,敲击键盘都无效,最后只能长按电源键来强 ...
- JAVA 编程思想一
1: 动态绑定和静态绑定 使用private或static或final修饰的变量或者方法,使用静态绑定.而虚方法(可以被子类重写的方法)则会根据运行时的对象进行动态绑定: 静态绑定使用类信息来完成,而 ...
- 计算机启动过程的简单介绍 计算机启动流程 计算机BIOS作用 POST 开机自检 计算机启动顺序 分区表 操作系统启动
原文地址:4.计算机启动过程的简单介绍 计算机启动流程 计算机BIOS作用 POST 开机自检 计算机启动顺序 分区表 操作系统启动 计算机的启动
- 从零开始学习GDI+ (二) 基本概念与基本操作
从零开始学习GDI+ (一)我的第一个GDI+程序 上文给新手学习GDI+讲述了vs环境等的准备工作,并且可以直接用GDI+绘图了.本文开始,讲述的可能偏理论,建议学习的过程中大胆尝试,多使用API. ...
- [转帖]IIS7 应用程序池的 托管管道模式与集成模式小结
IIS7 应用程序池的 托管管道模式与集成模式小结 https://www.jb51.net/article/26311.htm IIS7的一些问题. 关注脚本之家微信公众号(jb51net) 每周都 ...
- MyEclipse 2013 破解
本文链接:https://blog.csdn.net/Jayliue/article/details/97414181 1.运行cracker.jar 用 cd 命令找到 cracker.jar所在目 ...