每次搭建環境運行一段時間,後臺就會報錯:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections",碰到次數多了,一看就知道怎麼改了。mysql
一、找到C:\ProgramData\MySQL\MySQL Server 5.7下的my.ini文件並打開sql
二、修改max_connections的值,默認是151,通常設置到500~1000比較合適server
三、重啓MySQL,cmd窗口命令執行blog
中止--net stop mysqlcmd
啓動---net start mysqlio
四、再次運行環境,就不會遇到鏈接數過多問題了後臺