BUG排查:PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1040] Too ma
来源:互联网 发布:云计算市场分析报告 编辑:程序博客网 时间:2024/05/08 06:49
报错:
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1040] Too many connections' in /xxx/vendor/illuminate/database/Illuminate/Database/Connectors/Connector.php:47Stack trace:#0 /xxx/vendor/illuminate/database/Illuminate/Database/Connectors/Connector.php(47): PDO->__construct('mysql:host=192....', 'shoptsmaster', 'fuyuan1906', Array)
现象:
连接的进程老是被打断掉
排查:数据库问题
排查一:是不是长连接
排查二:数据库连接是否正常
查看数据库状态:show status like '%onn%';Aborted_connects 一直在增加
排查三:查看数据库短时间连接是否正常
原因:
mysql资源没有及时被释放
sql执行太快,导致链接太多
解决方法:
1、数据库连接过多,程序有问题,初步方案,建立连接的时候sleep
2、更改程序,数据库连接的复用。
类似现象:
1、闭包导致mysql进程被打断掉。
备注:
1、因为数据库长期看是正常的,运维说数据库没问题。
2、调整 mysql 超时时间 180s => 300s,现象不再出现。
以上两条导致了误导,根本原因还是数据库连接过多。
阅读全文
0 0
- BUG排查:PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1040] Too ma
- PHP + mysql 遇到Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error
- Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory解决方法
- drupal drush exception 'PDOException' with message 'SQLSTATE[HY000] [2002]
- 177 mysql PDOException' with message 'SQLSTATE[HY000]: General error'
- Fatal error: Uncaught exception 'PDOException'
- 报错 Exception 'yii\db\Exception' with message 'SQLSTATE[HY000]
- Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): It is not safe to
- Uncaught PDOException: SQLSTATE[HY000] [2002] No such file or directory
- Fatal error: Uncaught exception 'PHPExcel_Exception' with message 'Multibyte function overloading in
- Fatal error: Uncaught exception 'RedisException' with message 'Redis server went away'
- Mac下Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2002] No such file or directory'
- Mac下Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2002] No such file or directory'
- Mac下Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2002] No such file or directory'
- php artisan migrate时,[PDOException] SQLSTATE[HY000] [2002] No su
- PDO处理事务部分的报错 :Uncaught exception 'PDOException' with message There is no active transaction
- Fatal error: Uncaught SoapFault exception
- Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2002] No such file or directory’错误的解决方法
- RBAC权限管理(基于角色的访问控制)
- 三年开发两年前端,一个CSDN的老新人
- 安装 Go 第三方包 go-sqlite3
- 第十六周周末总结
- python 学习笔记之(四)while循环处理列表和字典
- BUG排查:PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1040] Too ma
- Stanford coursera Andrew Ng 机器学习课程编程作业(Exercise 1)Python3.x
- 20171216
- CXF
- TCP传输层协议
- 152. Maximum Product Subarray
- 2017年12月17日训练笔记
- 剑指offer 滑动窗口的最大值
- 网络编程三要素