当前位置:网站首页>Tp5.0框架 PDO连接mysql 报错:Too many connections 解决方法
Tp5.0框架 PDO连接mysql 报错:Too many connections 解决方法
2022-06-26 05:04:00 【你好骚啊】

由于技术经验有限,百度了许多关于这方面的案例,基本上都类似于
修改mysql目录下的my.ini,约在42行下方加入max_connections = 1000 。重启mysql就行。
Mysql达到连接数上限了,修改一下mysql的配置即可。
show variables like ‘%max_connections%’;
set global max_connections = 5000;
这样的答案,虽然可以缓解当下情况,但是终究没有解决本质的问题,经过摸索,问题终于得到了解决。
配置一下长连接就可以了。
找到项目中的databases.php 也就是数据库的配置文件
找到 params 数组,一般是空的。
给它配置参数:
\PDO::ATTR_PERSISTENT => true,
\PDO::ATTR_CASE => \PDO::CASE_LOWER,
接下上个图:
清理一下缓存,再刷新一下。 my.ini配置文件也不用修改。就可以了。
完美解决,敬礼、撒花!

边栏推荐
- ModuleNotFoundError: No module named ‘numpy‘
- date_ Range creation date range freq parameter value table and creation example
- Sklearn Library -- linear regression model
- Method of saving pictures in wechat applet
- Multipass中文文档-移除实例
- Zuul 實現動態路由
- The beautiful scenery is natural, and the wonderful pen is obtained by chance -- how is the "wonderful pen" refined?
- 天才制造者:独行侠、科技巨头和AI|深度学习崛起十年
- Hash problem
- Floyd
猜你喜欢

Final review of brain and cognitive science

Differences between TCP and UDP

PowerShell runtime system IO exceptions

Yolov5 super parameter setting and data enhancement analysis

FastAdmin Apache下设置伪静态

YOLOV5超参数设置与数据增强解析

Genius makers: lone Rangers, technology giants and AI | ten years of the rise of in-depth learning

【Unity3D】刚体组件Rigidbody

Windows下安装Tp6.0框架,图文。Thinkphp6.0安装教程

【Latex】错误类型总结(持更)
随机推荐
2022.2.15
广和通联合安提国际为基于英伟达 Jetson Xavier NX的AI边缘计算平台带来5G R16强大性能
First day of deep learning and tensorflow learning
-Discrete Mathematics - Analysis of final exercises
Zuul 实现动态路由
Differences between TCP and UDP
ssh连win10报错:Permission denied (publickey,keyboard-interactive).
2022.2.17
Transport layer TCP protocol and UDP protocol
6.1 - 6.2 introduction to public key cryptography
Method of saving pictures in wechat applet
[greedy college] recommended system engineer training plan
YOLOV5超参数设置与数据增强解析
Anti withdrawal test record
[unity3d] rigid body component
Simple application of KMP
Datetime data type ---now() gets the current time, datetime() creation date, performs mathematical operations, and to_ Datetime() converts to date type and extracts various parts of date
Collections and dictionaries
22.2.8
How MySQL deletes all redundant duplicate data