欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

mysql "too many connections" 錯(cuò)誤 之 mysql解決方法

 更新時(shí)間:2009年06月23日 19:01:08   作者:  
解決方法是修改/etc/mysql/my.cnf,添加以下一行
解決方法是修改/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)。

相關(guān)文章

  • Mysql日志文件和日志類型介紹

    Mysql日志文件和日志類型介紹

    這篇文章主要介紹了Mysql日志文件和日志類型介紹,本文講解了日志文件類型、錯(cuò)誤日志、通用查詢?nèi)罩?、慢速查詢?nèi)罩?、二進(jìn)制日志等內(nèi)容,需要的朋友可以參考下
    2014-12-12
  • MySQL分庫(kù)分表詳情

    MySQL分庫(kù)分表詳情

    互聯(lián)網(wǎng)項(xiàng)目中常用到的關(guān)系型數(shù)據(jù)庫(kù)是MySQL,隨著用戶和業(yè)務(wù)的增長(zhǎng),傳統(tǒng)的單庫(kù)單表模式難以滿足大量的業(yè)務(wù)數(shù)據(jù)存儲(chǔ)以及查詢,單庫(kù)單表中大量的數(shù)據(jù)會(huì)使寫入、查詢效率非常之慢,此時(shí)應(yīng)該采取分庫(kù)分表策略來(lái)解決。本篇文章主要介紹MySQL分庫(kù)分表,需要的朋友可以參考一下
    2021-09-09
  • InnoDB解決幻讀的方法詳解

    InnoDB解決幻讀的方法詳解

    這篇文章主要介紹了InnoDB解決幻讀的方法詳解的相關(guān)資料,需要的朋友可以參考下
    2023-04-04
  • MySQL中on?duplicate?key?update的使用方法實(shí)例

    MySQL中on?duplicate?key?update的使用方法實(shí)例

    在做數(shù)據(jù)統(tǒng)計(jì)的時(shí)候,我們經(jīng)常會(huì)用到mysql的on duplicate key update語(yǔ)法來(lái)自動(dòng)更新數(shù)據(jù),下面這篇文章主要給大家介紹了關(guān)于MySQL中on?duplicate?key?update的使用方法的相關(guān)資料,需要的朋友可以參考下
    2022-09-09
  • Mysql數(shù)據(jù)庫(kù)性能優(yōu)化一

    Mysql數(shù)據(jù)庫(kù)性能優(yōu)化一

    今天,數(shù)據(jù)庫(kù)的操作越來(lái)越成為整個(gè)應(yīng)用的性能瓶頸了,這點(diǎn)對(duì)于Web應(yīng)用尤其明顯。關(guān)于數(shù)據(jù)庫(kù)的性能,這并不只是DBA才需要擔(dān)心的事,而這更是我們程序員需要去關(guān)注的事情
    2016-04-04
  • Mysql 5.6添加修改用戶名和密碼的方法

    Mysql 5.6添加修改用戶名和密碼的方法

    這篇文章主要介紹了Mysql 5.6添加修改用戶名和密碼的方法,需要的朋友可以參考下
    2017-07-07
  • MySQL數(shù)據(jù)庫(kù)導(dǎo)出與導(dǎo)入及常見(jiàn)錯(cuò)誤解決

    MySQL數(shù)據(jù)庫(kù)導(dǎo)出與導(dǎo)入及常見(jiàn)錯(cuò)誤解決

    MySQL數(shù)據(jù)庫(kù)導(dǎo)出與導(dǎo)入的過(guò)程中將會(huì)發(fā)生眾多不可預(yù)知的錯(cuò)誤,本文整理了一些常見(jiàn)錯(cuò)誤及相應(yīng)的解決方法,遇到類似情況的朋友可以參考下,希望對(duì)大家有所幫助
    2013-07-07
  • mysql觸發(fā)器原理與用法實(shí)例分析

    mysql觸發(fā)器原理與用法實(shí)例分析

    這篇文章主要介紹了mysql觸發(fā)器原理與用法,結(jié)合實(shí)例形式分析了mysql觸發(fā)器基本概念、原理、用法及操作注意事項(xiàng),需要的朋友可以參考下
    2020-04-04
  • Ubuntu18.04 安裝mysql8.0.11的圖文教程

    Ubuntu18.04 安裝mysql8.0.11的圖文教程

    本文通過(guò)圖文并茂的形式給大家介紹了Ubuntu18.04 安裝mysql8.0.11的方法,非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的的朋友參考下吧
    2018-07-07
  • MySQL 5.7.17 免安裝版本的安裝配置

    MySQL 5.7.17 免安裝版本的安裝配置

    這篇文章主要為大家詳細(xì)介紹了MySQL 5.7.17 免安裝版本的安裝配置教程,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-11-11

最新評(píng)論