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

Mysql 錯誤too many connections解決方案

 更新時(shí)間:2016年11月07日 14:32:52   投稿:lqh  
這篇文章主要介紹了Mysql 錯誤too many connections解決方案的相關(guān)資料,這里提供了如何解決此問題,需要的朋友可以參考下

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

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

set-variable = max_connections=500

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

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

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

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è)置的問題

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

解決:

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

2.對處理量大的對數(shù)據(jù)庫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ù)被占滿

解決方式:

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

max_connections=1000

一定要重新啟動MYSQL才能生效

CMD->

net stop mysql

net start mysql

關(guān)于改變innodb_log_file_size后無法啟動mysql的問題

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

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

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

打開/MySQL Server 5.5/data

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

再開啟選項(xiàng),成功啟動。

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

相關(guān)文章

  • MySQL數(shù)據(jù)庫監(jiān)控軟件lepus使用問題以及解決辦法

    MySQL數(shù)據(jù)庫監(jiān)控軟件lepus使用問題以及解決辦法

    這篇文章主要介紹了MySQL數(shù)據(jù)庫監(jiān)控軟件lepus使用問題及解決辦法,非常不錯,具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2018-09-09
  • MySQL優(yōu)化之緩存優(yōu)化

    MySQL優(yōu)化之緩存優(yōu)化

    在平時(shí)被問及最多的問題就是關(guān)于 MySQL 數(shù)據(jù)庫性能優(yōu)化方面的問題,所以最近打算寫一個(gè)MySQL數(shù)據(jù)庫性能優(yōu)化方面的系列文章,希望對初中級 MySQL DBA 以及其他對 MySQL 性能優(yōu)化感興趣的朋友們有所幫助。
    2017-03-03
  • SQL匯總統(tǒng)計(jì)與GROUP BY過濾查詢實(shí)現(xiàn)

    SQL匯總統(tǒng)計(jì)與GROUP BY過濾查詢實(shí)現(xiàn)

    這篇文章主要介紹了SQL匯總統(tǒng)計(jì)與GROUP BY過濾查詢實(shí)現(xiàn),GROUP BY 實(shí)質(zhì)是先排序后分組,遵照索引建的最佳左前綴。當(dāng)無法使用索引時(shí),增大max_length_for_sort_data和sort_buffer參數(shù)的值
    2023-01-01
  • Windows安裝MySQL 5.7.18 解壓版的教程

    Windows安裝MySQL 5.7.18 解壓版的教程

    這篇文章主要為大家詳細(xì)介紹了Windows安裝MySQL 5.7.18 解壓版的詳細(xì)教程,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-07-07
  • MySQL Router實(shí)現(xiàn)MySQL的讀寫分離的方法

    MySQL Router實(shí)現(xiàn)MySQL的讀寫分離的方法

    MySQL Router是MySQL官方提供的一個(gè)輕量級MySQL中間件,用于取代以前老版本的SQL proxy。本文主要介紹了MySQL Router實(shí)現(xiàn)MySQL的讀寫分離的方法,感興趣的可以了解一下
    2021-05-05
  • MySQL到Kafka實(shí)時(shí)數(shù)據(jù)同步

    MySQL到Kafka實(shí)時(shí)數(shù)據(jù)同步

    很多 DBA 同學(xué)經(jīng)常會遇到要從一個(gè)數(shù)據(jù)庫實(shí)時(shí)同步到另一個(gè)數(shù)據(jù)庫的問題,同構(gòu)數(shù)據(jù)還相對容易,遇上異構(gòu)數(shù)據(jù)、表多、數(shù)據(jù)量大等情況就難以同步,我自己親測了一種方式,可以非常方便的實(shí)現(xiàn)MySQL Kafka實(shí)時(shí)數(shù)據(jù)同步,需要的朋友可以參考下
    2024-01-01
  • MySQL數(shù)據(jù)表合并去重的簡單實(shí)現(xiàn)方法

    MySQL數(shù)據(jù)表合并去重的簡單實(shí)現(xiàn)方法

    這篇文章主要給大家介紹了關(guān)于MySQL數(shù)據(jù)表合并去重的簡單實(shí)現(xiàn)方法,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用MySQL具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-05-05
  • 淺談mysql數(shù)據(jù)庫中的換行符與textarea中的換行符

    淺談mysql數(shù)據(jù)庫中的換行符與textarea中的換行符

    下面小編就為大家?guī)硪黄獪\談mysql數(shù)據(jù)庫中的換行符與textarea中的換行符。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-01-01
  • MyEclipse通過JDBC連接MySQL數(shù)據(jù)庫基本介紹

    MyEclipse通過JDBC連接MySQL數(shù)據(jù)庫基本介紹

    MyEclipse使用Java 通過JDBC連接MySQL數(shù)據(jù)庫的基本測試前提是MyEclipse已經(jīng)能正常開發(fā)Java工程
    2012-11-11
  • MySQL之where使用詳解

    MySQL之where使用詳解

    我們需要獲取數(shù)據(jù)庫表數(shù)據(jù)的特定子集時(shí),可以使用where子句指定搜索條件進(jìn)行過濾。本文主要介紹了MySQL之where使用,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-11-11

最新評論