内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

怎么解決mysql中的ERROR1135(HY000)報錯問題-創(chuàng)新互聯(lián)

這篇文章主要講解了“怎么解決mysql中的ERROR 1135 (HY000)報錯問題”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“怎么解決mysql中的ERROR 1135 (HY000)報錯問題”吧!

創(chuàng)新互聯(lián)主要從事網(wǎng)站設計、做網(wǎng)站、網(wǎng)頁設計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務。立足成都服務荊門,10余年網(wǎng)站建設經(jīng)驗,價格優(yōu)惠、服務專業(yè),歡迎來電咨詢建站服務:028-86922220

收到報錯:

[root@i-iivphroy ~]# mysql -uroot -p*********  -h292.168.0.254

ERROR 1135 (HY000): Can't create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug

馬上google一番,有人說可能說磁盤空間滿了,經(jīng)查看發(fā)現(xiàn)果然是磁盤滿了,(這個盤一直空間很緊張(95%),我高度警惕著,天天檢查,可是昨天我執(zhí)行了個大事務,產(chǎn)生了大量的binlog,給一下子撐爆了)

馬上刪除了幾天前的binlog和一些別的不需要的數(shù)據(jù),空間釋放到了80%,再次登錄mysql

[root@i-iivphroy ~]# mysql -uroot -p******* -h292.168.0.254

依舊報錯:

ERROR 1135 (HY000): Can't create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug

再次google一番,查到下面這個文檔:

This error was the bane of my life for a while, and it was very hard to get a definitive answer as to what was causing it, I hope this saves you some trouble.

My website occasionally got large traffic spikes, and at the top of these peaks, I would start to see errors like these:

MySQL error #1135: Can’t create a new thread (errno 11). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug.

I looked in the my.cnf file on the db server and looked at the open files limit, because a process is counted as an open file, but it seemed fine:

[mysqld_safe]

open-files-limit=10240

I also checked that maximum connections was high enough, it was at 2048.

What the open-files-limit in my.cnf files does is it tells the init script to use ulimit to whatever number you put in there.

After a lot of digging around various places, and much frustration, I discovered that by default linux has a hard limit of 1024 open files for all non super-users, so even though I had set a high open-files-limit, it was capped at 1024 by the OS. I also discovered how to raise it;

/etc/security/limits.conf

This file is used by PAM to set things like maximum processes, max open files, memory usage etc and these limits can be set on a per-user basis, so I added these lines:

mysql soft nofile 4096

mysql hard nofile 4096

大體的意思是說,這個報錯的原因:由于:mysql的配置文件/etc/my.cnf的參數(shù)open-files-limit設置的比linux的max user processes的數(shù)值大,需要通過修改linux的配置文件 /etc/security/limits.d/90-nproc.conf來擴大linux系統(tǒng)的限制,也就是這個錯是由于linux的max user processes閾值太小了。

馬上查看我的相關配置:

mysql的open-files-limit,如下所示:

[root@i-iivphroy ~]# cat /etc/my.cnf

[mysqld_safe]

open-files-limit=85216

linux的max user processes,如下所示紅色部分:

[root@i-iivphroy ~]# ulimit -a

core file size          (blocks, -c) 0

data seg size           (kbytes, -d) unlimited

scheduling priority             (-e) 0

file size               (blocks, -f) unlimited

pending signals                 (-i) 62842

max locked memory       (kbytes, -l) 64

max memory size         (kbytes, -m) unlimited

open files                      (-n) 1024

pipe size            (512 bytes, -p) 8

POSIX message queues     (bytes, -q) 819200

real-time priority              (-r) 0

stack size              (kbytes, -s) 10240

cpu time               (seconds, -t) unlimited

max user processes              (-u) 62842

virtual memory          (kbytes, -v) unlimited

file locks                      (-x) unlimited

將查看果然是前面文檔描述的情況,馬上修改max user processes

方法一:

[root@i-iivphroy ~]# cat  /etc/security/limits.conf

*  soft nofile 65535

*  hard nofile 65535

* soft nproc 65535

* hard nproc 65535

其中nofile對應open_files

nproc對應max_user_processes

但是在Linux 6.4之后,如果只修改了該文件中的nproc,那么其他非root用戶對應的max_user_processes并不會改變,仍然是1024,這個是因為受到了下面這個文件的影響

/etc/security/limits.d/90-nproc.conf

修改/etc/security/limits.d/90-nproc.conf將

* soft nproc 1024

修改為:

* soft nproc 65535

或者

修改/etc/security/limits.conf,將

* soft nofile 10240

修改為

Oracle  soft nofile 10240

方法二:這樣為每一個運行bash shell的用戶執(zhí)行此文件,當bash shell被打開時,該文件被讀取。也就是說,當用戶shell執(zhí)行了bash時,運行這個文件,如果這個服務器上有多個用戶,最好是用方法一。

修改了/etc/bashrc,成功了,并且不用重啟。

vi /etc/bashrc

添加 :

ulimit -u 65535

退出session,從新開session再次ulimit -a 發(fā)現(xiàn)已經(jīng)變化了

[root@i-iivphroy ~]# ulimit -a

core file size          (blocks, -c) 0

data seg size           (kbytes, -d) unlimited

scheduling priority             (-e) 0

file size               (blocks, -f) unlimited

pending signals                 (-i) 62842

max locked memory       (kbytes, -l) 64

max memory size         (kbytes, -m) unlimited

open files                      (-n) 1024

pipe size            (512 bytes, -p) 8

POSIX message queues     (bytes, -q) 819200

real-time priority              (-r) 0

stack size              (kbytes, -s) 10240

cpu time               (seconds, -t) unlimited

max user processes              (-u) 65535

virtual memory          (kbytes, -v) unlimited

file locks                      (-x) unlimited

并且把mysql的open-files-limit改小。

[root@i-iivphroy ~]# cat /etc/my.cnf

[mysqld_safe]

open-files-limit=65000

重啟了mysql服務,問題解決。。。。

原因分析:

操作系統(tǒng)連接數(shù)太小。(比如centos 6 默認的  max user process只有 1024個。當mysql process大于這個值時 就會出現(xiàn)Can't create a new thread的問題)

連接數(shù)超限處理的辦法:

ulimit -a

查看max user processes 這一項

要是這個值比較的小 當mysql中process的數(shù)目超過這個數(shù)的時候 就會抱標題相應的錯誤。

一個過程process可以視為一個打開的文件

也就是說 下面幾個參數(shù)共同控制這mysql的 create a new thread

1) mysql的 /etc/my.cnf

open-files-limit=65535

2)linux  參數(shù)   open files和max user processes

[root@S243 ~]# ulimit

unlimited

[root@S243 ~]# ulimit -a

core file size          (blocks, -c) 0

data seg size           (kbytes, -d) unlimited

scheduling priority             (-e) 0

file size               (blocks, -f) unlimited

pending signals                 (-i) 1032207

max locked memory       (kbytes, -l) 64

max memory size         (kbytes, -m) unlimited

open files                      (-n) 50000

pipe size            (512 bytes, -p) 8

POSIX message queues     (bytes, -q) 819200

real-time priority              (-r) 0

stack size              (kbytes, -s) 10240

cpu time               (seconds, -t) unlimited

max user processes              (-u) 65535

virtual memory          (kbytes, -v) unlimited

file locks                      (-x) unlimited

感謝各位的閱讀,以上就是“怎么解決mysql中的ERROR 1135 (HY000)報錯問題”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對怎么解決mysql中的ERROR 1135 (HY000)報錯問題這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關知識點的文章,歡迎關注!

當前文章:怎么解決mysql中的ERROR1135(HY000)報錯問題-創(chuàng)新互聯(lián)
文章轉(zhuǎn)載:http://www.rwnh.cn/article14/pcoge.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設、移動網(wǎng)站建設、關鍵詞優(yōu)化、網(wǎng)頁設計公司、手機網(wǎng)站建設、動態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站建設網(wǎng)站維護公司
邛崃市| 星座| 苍山县| 临清市| 安多县| 张家界市| 胶州市| 海伦市| 卢氏县| 神池县| 远安县| 梓潼县| 新宾| 开阳县| 绩溪县| 尉氏县| 托克托县| 深州市| 南靖县| 弥渡县| 龙岩市| 翁源县| 双江| 鸡西市| 东安县| 泊头市| 普兰店市| 吉木乃县| 福海县| 余姚市| 衡阳县| 玉林市| 武陟县| 宁安市| 衡阳市| 郧西县| 上犹县| 阿克苏市| 缙云县| 莲花县| 浏阳市|