当前位置:网站首页>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配置文件也不用修改。就可以了。
完美解决,敬礼、撒花!

边栏推荐
- Zuul 實現動態路由
- Condition query
- 广和通联合安提国际为基于英伟达 Jetson Xavier NX的AI边缘计算平台带来5G R16强大性能
- LeetCode 19. 删除链表的倒数第 N 个结点
- Collections and dictionaries
- Genius makers: lone Rangers, technology giants and AI | ten years of the rise of in-depth learning
- 6.1 - 6.2 introduction to public key cryptography
- ModuleNotFoundError: No module named ‘numpy‘
- 天才制造者:獨行俠、科技巨頭和AI|深度學習崛起十年
- 关于支付接口回调地址参数字段是“notify_url”,签名过后的特殊字符url编码以后再解码后出现错误(¬ , ¢, ¤, £)
猜你喜欢

【Unity3D】人机交互Input

Beidou navigation technology and industrial application of "chasing dreams in space and feeling for Beidou"

How MySQL deletes all redundant duplicate data

广和通联合安提国际为基于英伟达 Jetson Xavier NX的AI边缘计算平台带来5G R16强大性能
![[unity3d] human computer interaction input](/img/4d/47f6d40bb82400fe9c6d624c8892f7.png)
[unity3d] human computer interaction input

Statsmodels Library -- linear regression model

pycharm 导包错误没有警告

5. < tag stack and general problems > supplement: lt.946 Verify the stack sequence (the same as the push in and pop-up sequence of offer 31. stack)

Learn from small samples and run to the sea of stars

Codeforces Round #800 (Div. 2)
随机推荐
RESNET practice in tensorflow
Use to_ Numeric to numeric type
Windows下安装Tp6.0框架,图文。Thinkphp6.0安装教程
zencart新建的URL怎么重写伪静态
File upload and security dog
22.2.8
Floyd
Record a circular reference problem
A company crawling out of its grave
Multipass Chinese document - share data with instances
Yolov5 super parameter setting and data enhancement analysis
钟珊珊:被爆锤后的工程师会起飞|OneFlow U
Guanghetong and anti international bring 5g R16 powerful performance to the AI edge computing platform based on NVIDIA Jetson Xavier nx
86.(cesium篇)cesium叠加面接收阴影效果(gltf模型)
GD32F3x0 官方PWM驱动正频宽偏小(定时不准)的问题
6.1 - 6.2 公钥密码学简介
Multipass中文文档-与实例共享数据
【Latex】错误类型总结(持更)
微信小程序保存圖片的方法
Multipass Chinese document - use multipass service to authorize the client