当前位置:网站首页>Tp5.0 framework PDO connection MySQL error: too many connections solution

Tp5.0 framework PDO connection MySQL error: too many connections solution

2022-06-26 05:09:00 You are sexy!

Due to limited technical experience , Baidu has many cases about this , They are basically similar to  
modify mysql In the catalog my.ini, About the 42 Add below line max_connections = 1000 . restart mysql Just go .
 

Mysql The maximum number of connections has been reached , Revise it mysql Can be configured .

show variables like ‘%max_connections%’;
set global max_connections = 5000;
That's the answer , Although it can alleviate the current situation , But it has not solved the essential problem after all , After groping , The problem was finally solved .
Just configure the long connection .

Find... In the project databases.php That is, the configuration file of the database

find  params Array , It's usually empty .

Configure it with parameters :

\PDO::ATTR_PERSISTENT   => true,
\PDO::ATTR_CASE         => \PDO::CASE_LOWER,

 

Continue from the previous figure :

 

Clean up the cache , Refresh again . my.ini The configuration file does not need to be modified . That's all right. .

Perfect solution , salute 、 And the flower !

原网站

版权声明
本文为[You are sexy!]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206260504427737.html