Data source rejected establishment of connection, message from server: "Too many connections&qu

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Data source rejected establishment of connection, message from server: "Too many connections&qu相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/%e6%9c%80%e5%a4%a7' title='鏈€澶?>鏈€澶?/a>   spring   瀵艰嚧   ring   鏈€澶ц繛鎺ユ暟   tran   window   start   serve   

 

寮傚父淇℃伅锛欴ata source rejected establishment of connection,  message from server: "Too many connections"

 


鍙兘鐨勫師鍥?/p>

1.mysql鐨刴ax_connections灞炴€ч厤缃お灏忕殑闂
2.鍙兘鏄娆nsert,update鎿嶄綔娌℃湁鍏抽棴session銆?/p>

 

瑙e喅鏂规锛?br />1.淇敼tomcat閲岀殑session 鐨剋ait_timeout鏃堕棿鍑忓皯涓?00
2.瀵瑰鐞嗛噺澶х殑瀵规暟鎹簱insert鎴杣pdate鐨勬搷浣滄彁渚泃ransaction鏀寔.锛圫pring涓厤缃級

鍘熷洜锛?/p>

mysql瀹夎鐩綍涓嬬殑my.ini锛坙inux: my.cnf锛変腑璁惧畾鐨勫苟鍙戣繛鎺ユ暟澶皯鎴栬€呯郴缁熺箒蹇欏鑷磋繛鎺ユ暟琚崰婊?/p>


瑙e喅鏂瑰紡锛?/p>

Windows: 鎵惧埌mysql鐨勫畨瑁呯洰褰曪紝鎵撳紑my.ini鏂囦欢锛屾壘鍒癿ax_connections閰嶇疆锛岄粯璁ゆ槸100锛岃缃垚1000锛岄噸鍚痬ysql

涓€瀹氳閲嶆柊鍚姩MYSQL鎵嶈兘鐢熸晥

cmd涓嬫墽琛?/p>

net stop mysql

net start mysql

 

Linux: 鎵惧埌mysql鐨勫畨瑁呯洰褰曪紝鎵撳紑my.cnf鏂囦欢

 

鍦╗mysqld] 涓嬮潰娣诲姞涓嬮潰涓夎


max_connections=1000
max_user_connections=500

wait_timeout=200

 

//max_connections璁剧疆鏈€澶ц繛鎺ユ暟涓?000

//max_user_connections璁剧疆姣忕敤鎴锋渶澶ц繛鎺ユ暟涓?00
//wait_timeout琛ㄧず200绉掑悗灏嗗叧闂┖闂诧紙IDLE锛夌殑杩炴帴锛屼絾鏄姝e湪宸ヤ綔鐨勮繛鎺ヤ笉褰卞搷銆?/p>

//淇濆瓨閫€鍑猴紝骞堕噸鏂板惎鍔∕ySQL

sudo stop mysql

sudo start mysql

 

//閲嶆柊鍚姩MySQL鍚庝娇鐢ㄤ笅闈㈢殑鍛戒护鏌ョ湅淇敼鏄惁鎴愬姛

# mysqladmin -uroot -p variables

Password:

//鍙互鐪嬪埌浠ヤ笅椤硅鏄庝慨鏀规垚鍔?/p>

| max_connections                 | 1000

| max_user_connections            | 500

| wait_timeout                    | 200
————————————————
鍘熸枃閾炬帴锛歨ttps://blog.csdn.net/ljphhj/article/details/23804057

以上是关于Data source rejected establishment of connection, message from server: "Too many connections&qu的主要内容,如果未能解决你的问题,请参考以下文章

Data source rejected establishment of connection, message from server: "Too many connections&q

Data source rejected establishment of connection, message from server: "Too many connections&qu

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establish

Data source rejected establishment of connection, message from server: "Too many connections&qu

Data source rejected establishment of connection, message from server: "Too many connections&qu

今天碰到报错 Data source rejected establishment of connection, message from server: "Too many conne