mysql---連接數太多 (1040 too many connection),調大連接 (親測有用)


解決問題:mysql 1040 too many connections

 

當項目mysql數據庫連接太多-報錯--1040 too many connection

 

重啟mysql 服務器 (systemctl restart mysqld.service)

1、mysql -u root -p 回車輸入密碼進入mysql

 

2、執行show variables like "max_connections"; (查詢當前的最大連接數)

 

 3、執行set GLOBAL max_connections=10000; (修改最大連接數)

 

 4、執行show variables like "max_connections";  

 

 

 

此時就解決了!

 

注意:mysql服務器重啟之后就會恢復默認的最大連接!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM