今天打开网站,出现Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)这个错误,数据库又挂了。进入mysql错误日志,出现以下记录:
151004 16:11:13 [Note] Plugin ‘FEDERATED’ is disabled.
151004 16:11:13 InnoDB: The InnoDB memory heap is disabled
151004 16:11:13 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151004 16:11:13 InnoDB: Compressed tables use zlib 1.2.7
151004 16:11:13 InnoDB: Using Linux native AIO
151004 16:11:13 InnoDB: Initializing buffer pool, size = 5.0M
151004 16:11:13 InnoDB: Completed initialization of buffer pool
InnoDB: Error: pthread_create returned 11
151004 16:11:13 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
151006 02:47:19 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
网上查了一下,有临时解决办法:
#ulimit -s unlimited
这个是临时的,没有保存,系统重启或者重新登录后会失效。
或者修改文件 /etc/profile,添加
ulimit -s unlimited