Mysql中too many connections問題的解決
使用mysql,經常碰到too many connections的報錯,登入不上去,只能重新啟動。透過如下的方法可以解決這個問題:
1。首先修改/etc/my.cnf檔案,增加如下一行
set-variable = max_connections=500
或在啟動命令中加上引數 max_connections=500
就是修改最大連線數,然後重啟mysql.預設的連線數是100,太少了,所以容易出現如題錯誤.
2。重新啟動mysql,透過show variables可以檢視max_connections是否修改成功。
3。為了防止發生too many connections時候無法登入的問題,mysql manual有如下的說明:
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.
因此, 必須只賦予root使用者的SUPER許可權,同時所有資料庫連線的帳戶不能賦予SUPER許可權。前面說到的報錯後無法登入就是由於我們的應用程式直接配置的root使用者
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/14663377/viewspace-1056375/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 關於mysql的Too many connections問題MySql
- MySQL: Too many connectionsMySql
- 解決Mysql錯誤[1040]Too many connectionsMySql
- mysql的max_connections和Too many connectionsMySql
- MySQL問題處理——1040錯誤Too many connectionsMySql
- MySQL ERROR 1040: Too many connectionsMySqlError
- 【MySQL】Too many connections 案例一則MySql
- Ubuntu 解決 Too many open files 問題Ubuntu
- 解決 Too many symbol filesSymbol
- 解決WebLogic中Too many open files異常Web
- linux Too Many Files 問題檢視和解決方法Linux
- 連線雲虛擬主機中MySQL資料庫時出現“Too many connections”報錯資訊MySql資料庫
- krpano 問題解決之 “Too many active WebGL contexts. Oldest context will be lost.”WebContext
- mysql連線數設定操作(Too many connections)及設定md5值的加密密碼MySql加密密碼
- Mysql報Too many connections,不要亂用ulimit了,看看如何正確修改程式的最大檔案數MySqlMIT
- 解決:ChatGPT too many requests in 1 hour.Try again laterChatGPTAI
- mysql備份提示 too many open files Errornumber 24MySqlError
- gunzip時,提示file too large(問題已解決)
- Java程式碼解決ElasticSearch的Result window is too large問題JavaElasticsearch
- 【mysql】配置MySQL,解決安裝過程中的問題MySql
- [Mark]解決ElasticSearch深度分頁機制中Result window is too large問題Elasticsearch
- 解決 Specified key was too long ... 767 bytes 的本質問題
- jive中MySQL中文問題解決一法MySql
- 解決 ln -s 軟連結產生的Too many levels of symbolic links錯誤Symbol
- Many To Many could not initialize proxy – no Session的解決方法Session
- Too many open files in system處理
- MySQL資料庫index column size too large. the maximum column size is 767 bytes問題解決MySql資料庫Index
- MySQL 中文 like 問題解決MySql
- mysql大小寫問題解決MySql
- Too many open files報錯處理
- [HP-UX] cannot fork: too many processesUX
- NETAPP - LOGIN TOO MANY USERSAPP
- when tag object too many, performance very lowObjectORM
- Too many files with unapproved license異常APP
- MySql中文亂碼問題解決MySql
- 解決MySQL中文亂碼問題MySql
- MYSQL亂碼問題解決方法MySql
- 解決bash: mysql: command not found的問題MySql