在進行數據庫備份的時候發現服務器報 mysqldump: Got 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 when trying to connect 錯誤

,出現原因是服務器的連接數太多了,當mysql的連接數大於默認數值(1024)時,就會出現這個錯誤,需要增加服務器的最大連接數,方法如下:
打開 /etc/security/limits.conf
增加兩行參數:
* soft nofile 65535
* hard nofile 409600
為了避免重啟服務器可以在命令行中執行:
ulimit -u 65535

驗證下mysql的最大連接數
cat /proc/`pidof mysqld`/limits | egrep "(processes|files)"
Max processes 65535 65535 processes
Max open files 65535 409600 files
