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

边栏推荐
- Introduction to classification data cotegory and properties and methods of common APIs
- Zuul 實現動態路由
- Some parameter settings and feature graph visualization of yolov5-6.0
- Tensorflow and deep learning day 3
- Muke.com actual combat course
- Multipass中文文档-使用实例命令别名
- Resample
- Sentimentin tensorflow_ analysis_ layer
- 6.1 - 6.2 introduction to public key cryptography
- File upload and security dog
猜你喜欢

zencart新建的URL怎么重写伪静态

Transport layer TCP protocol and UDP protocol

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

torchvision_ Transform (image enhancement)

【Unity3D】碰撞体组件Collider
![C# 39. string类型和byte[]类型相互转换(实测)](/img/33/046aef4e0c1d7c0c0d60c28e707546.png)
C# 39. string类型和byte[]类型相互转换(实测)

Machine learning final exercises
![[latex] error type summary (hold the change)](/img/3c/bbb7f496c5ea48c6941cd4aceb5065.png)
[latex] error type summary (hold the change)

6.1 - 6.2 公钥密码学简介

YOLOV5超参数设置与数据增强解析
随机推荐
【Latex】错误类型总结(持更)
Schematic diagram of UWB ultra high precision positioning system
C# 40. byte[]与16进制string互转
The beautiful scenery is natural, and the wonderful pen is obtained by chance -- how is the "wonderful pen" refined?
Using requests library and re library to crawl web pages
MySql如何删除所有多余的重复数据
ThreadPoolExecutor实现文件上传批量插入数据
Floyd
RESNET in tensorflow_ Train actual combat
Créateur de génie: cavalier solitaire, magnat de la technologie et ai | dix ans d'apprentissage profond
6.1 - 6.2 Introduction à la cryptographie à clé publique
YOLOv5-6.0的一些参数设置和特征图可视化
一个从坟墓里爬出的公司
Rsync common error messages (common errors on the window)
钟珊珊:被爆锤后的工程师会起飞|OneFlow U
Guanghetong and anti international bring 5g R16 powerful performance to the AI edge computing platform based on NVIDIA Jetson Xavier nx
Windows下安装Tp6.0框架,图文。Thinkphp6.0安装教程
Selection of programming language
Astype conversion data type
C# 39. string类型和byte[]类型相互转换(实测)