濮阳杆衣贸易有限公司

主頁(yè) > 知識(shí)庫(kù) > Mysql 錯(cuò)誤too many connections解決方案

Mysql 錯(cuò)誤too many connections解決方案

熱門標(biāo)簽:地圖標(biāo)注專員入駐 西藏地圖標(biāo)注改進(jìn)點(diǎn) 地圖標(biāo)注百度競(jìng)價(jià) 外呼系統(tǒng)線路經(jīng)常出問(wèn)題嗎 地圖標(biāo)注什么軟件好用 神行者百貨商場(chǎng)地圖標(biāo)注 外呼系統(tǒng)怎樣才能不封號(hào) 如何辦理400客服電話 安陽(yáng)手機(jī)自動(dòng)外呼系統(tǒng)原理是什么

Mysql 錯(cuò)誤提示too many connections,最近遇到這個(gè)錯(cuò)誤,經(jīng)過(guò)上網(wǎng)查資料解決了,這里記錄下,幫助有需要的朋友,

解決方法是修改/etc/mysql/my.cnf,添加以下一行:

set-variable = max_connections=500

或在啟動(dòng)命令中加上參數(shù) max_connections=500

就是修改最大連接數(shù),然后重啟mysql.默認(rèn)的連接數(shù)是100,太少了,所以容易出現(xiàn)如題錯(cuò)誤.

以下是mysql.com網(wǎng)站的相關(guān)說(shuō)明:

If you get a Too many connections error when you try to connect to the mysqld server, this means that all available connections are in use by other clients.

The number of connections allowed is controlled by the max_connections system variable. Its default value is 100. If you need to support more connections, you should restart mysqld with a larger value for this variable.

mysqld actually allows max_connections+1 clients to connect. The extra connection is reserved for use by accounts that have the SUPER privilege. By granting the SUPER privilege to administrators and not to normal users (who should not need it), an administrator can connect to the server and use SHOW PROCESSLIST to diagnose problems even if the maximum number of unprivileged clients are connected. See Section 13.5.4.19, “SHOW PROCESSLIST Syntax”.

The maximum number of connections MySQL can support depends on the quality of the thread library on a given platform. Linux or Solaris should be able to support 500-1000 simultaneous connections, depending on how much RAM you have and what your clients are doing. Static Linux binaries provided by MySQL AB can support up to 4000 connections.

1.可能是mysql的max connections設(shè)置的問(wèn)題

2.可能是多次insert,update操作沒(méi)有關(guān)閉session,需要在spring里配置transaction支持。

解決:

1.修改tomcat里的session 的time-out時(shí)間減少為20,(不是必改項(xiàng))

2.對(duì)處理量大的對(duì)數(shù)據(jù)庫(kù)insert或update的操作提供transaction支持.

=======================================

下面的是解決辦法:

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"

原因:

因?yàn)槟愕膍ysql安裝目錄下的my.ini中設(shè)定的并發(fā)連接數(shù)太少或者系統(tǒng)繁忙導(dǎo)致連接數(shù)被占滿

解決方式:

打開(kāi)MYSQL安裝目錄打開(kāi)MY.INI找到max_connections(在大約第93行)默認(rèn)是100 一般設(shè)置到500~1000比較合適,重啟mysql,這樣1040錯(cuò)誤就解決啦。

max_connections=1000

一定要重新啟動(dòng)MYSQL才能生效

CMD->

net stop mysql

net start mysql

關(guān)于改變innodb_log_file_size后無(wú)法啟動(dòng)mysql的問(wèn)題

innodb_buffer_pool_size=768M

innodb_log_file_size=256M

innodb_log_buffer_size=8M

innodb_additional_mem_pool_size=4M

innodb_flush_log_at_trx_commit=0

innodb_thread_concurrency=20

以上是對(duì)innodb引擎的初步優(yōu)化, 發(fā)現(xiàn)是更新innodb_log_file_size=256M時(shí)候出現(xiàn)了問(wèn)題,只要加上這個(gè)就無(wú)法啟動(dòng),

后來(lái)才知道原來(lái)要STOP服務(wù)先,然后再刪除原來(lái)的文件………

打開(kāi)/MySQL Server 5.5/data

刪除ib_logfile0, ib_logfile1........ib_logfilen

再開(kāi)啟選項(xiàng),成功啟動(dòng)。

感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

您可能感興趣的文章:
  • Mysql錯(cuò)誤:Too many connections的解決方法
  • mysql連接數(shù)設(shè)置操作方法(Too many connections)
  • mysql too many open connections問(wèn)題解決方法
  • 解決mysql 1040錯(cuò)誤Too many connections的方法
  • mysql "too many connections" 錯(cuò)誤 之 mysql解決方法
  • MySQL too many connections錯(cuò)誤的原因及解決

標(biāo)簽:萍鄉(xiāng) 雞西 張掖 貴港 阜陽(yáng) 酒泉 衡水 AXB

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Mysql 錯(cuò)誤too many connections解決方案》,本文關(guān)鍵詞  Mysql,錯(cuò)誤,too,many,connections,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Mysql 錯(cuò)誤too many connections解決方案》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于Mysql 錯(cuò)誤too many connections解決方案的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    杭锦后旗| 措勤县| 确山县| 富平县| 汉沽区| 尚志市| 上杭县| 崇州市| 永城市| 额尔古纳市| 恩施市| 五河县| 张家川| 丹凤县| 邯郸市| 台南县| 望江县| 和平县| 枣阳市| 公主岭市| 石屏县| 长岭县| 平安县| 沙湾县| 南投县| 屏东县| 望奎县| 嘉鱼县| 双城市| 社会| 乌拉特前旗| 桐城市| 晋宁县| 元阳县| 扬州市| 乡宁县| 朔州市| 六枝特区| 沭阳县| 进贤县| 筠连县|