当前位置:网站首页>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配置文件也不用修改。就可以了。
完美解决,敬礼、撒花!
边栏推荐
- Illustration of ONEFLOW's learning rate adjustment strategy
- ROS 笔记(07)— 客户端 Client 和服务端 Server 的实现
- [greedy college] recommended system engineer training plan
- Differences between TCP and UDP
- ModuleNotFoundError: No module named ‘numpy‘
- 0622 horse palm fell 9%
- Ai+ remote sensing: releasing the value of each pixel
- 2022.1.24
- PowerShell runtime system IO exceptions
- ThreadPoolExecutor实现文件上传批量插入数据
猜你喜欢
Learn from small samples and run to the sea of stars
C# 40. byte[]与16进制string互转
天才制造者:獨行俠、科技巨頭和AI|深度學習崛起十年
Codeforces Round #800 (Div. 2)
Ai+ remote sensing: releasing the value of each pixel
Using requests library and re library to crawl web pages
Zuul 實現動態路由
ROS 笔记(07)— 客户端 Client 和服务端 Server 的实现
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)
Statsmodels Library -- linear regression model
随机推荐
First day of deep learning and tensorflow learning
C# 40. byte[]与16进制string互转
6.1 - 6.2 公鑰密碼學簡介
2. < tag dynamic programming and conventional problems > lt.343 integer partition
Sort query
[ide (imagebed)]picgo+typora+aliyunoss deployment blog Gallery (2022.6)
Record a circular reference problem
图像翻译/GAN:Unsupervised Image-to-Image Translation with Self-Attention Networks基于自我注意网络的无监督图像到图像的翻译
LSTM in tensorflow_ Layers actual combat
Use fill and fill in Matplotlib_ Between fill the blank area between functions
2022.2.17
PSIM software learning ---08 call of C program block
-Discrete Mathematics - Analysis of final exercises
5. <tag-栈和常规问题>补充: lt.946. 验证栈序列(同剑指 Offer 31. 栈的压入、弹出序列)
【quartz】从数据库中读取配置实现动态定时任务
Codeforces Round #800 (Div. 2)
A company crawling out of its grave
LeetCode 19. 删除链表的倒数第 N 个结点
PHP之一句话木马
Zuul 实现动态路由