简体   繁体   中英

Mysql: Too many connections to database

recently encountered such a problem, mysql permanently crash with error "Too many connections".

Connections limit was increased(350 connections), but this not help for me. I am use PDO with persistent connection, but still open for new connections.

In what could be the problem? Thanks.

Judging by code I've seen in other questions under pdo tag, most likely you are opening new connection for the every query. So, persistent connection makes it even worse.

Create only one single connection and use it throughout whole app, and error will be gone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM