django连接不到mysql_mysql – Django偶尔也无法连接到数据库(Centos)

我有一个非常奇怪的问题,我有一个运行mod_wsgi的Apache服务器.该网站运行良好,但每隔一段时间我就得到了

IOError: failed to write data

网站的所有页面上的错误.然后我解决了

sudo service mysqld restart

由于网站不能长时间停机,我没有时间调试这个问题,我只是每次都发生这个命令.我只看到日志中的错误,这就是为什么我无法真正调试它,它没有明确的复制步骤,它只是随机发生.

任何帮助将不胜感激,如果您需要我发布任何配置文件,请告诉我.

编辑:django显示的确切错误是:

(2002,"Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")

我保存了错误消息,它托管了here.(密码已删除)

编辑:

这是mysql服务器错误日志的摘录.

160610 10:51:53 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

160610 10:51:53 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.46) starting as process 7658 ...

160617 14:35:47 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.46) starting as process 32054 ...

160617 14:35:47 [Note] Plugin 'FEDERATED' is disabled.

160617 14:35:47 InnoDB: The InnoDB memory heap is disabled

160617 14:35:47 InnoDB: Mutexes and rw_locks use GCC atomic builtins

160617 14:35:47 InnoDB: Compressed tables use zlib 1.2.8

160617 14:35:47 InnoDB: Using Linux native AIO

160617 14:35:47 InnoDB: Initializing buffer pool,size = 128.0M

InnoDB: mmap(137363456 bytes) failed; errno 12

160617 14:35:47 InnoDB: Completed initialization of buffer pool

160617 14:35:47 InnoDB: Fatal error: cannot allocate memory for the buffer pool

160617 14:35:47 [ERROR] Plugin 'InnoDB' init function returned error.

160617 14:35:47 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

160617 14:35:47 [ERROR] Unknown/unsupported storage engine: InnoDB

160617 14:35:47 [ERROR] Aborting

我保存了完整的mysqld.log here.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值