Mysql报错 :Unknown table engine 'InnoDB'


问题:

    zabbix服务器重启后,进入zabbix的web发现登录不进去并且网页报mysql的错误,查看mysql的日之后,发现报错:

[root@czy ~]# tail -f /var/log/mysqld.log 

140820 16:24:43 [Note] /usr/libexec/mysqld: ready for connections.

Version: ‘5.1.73‘  socket: ‘/var/lib/mysql/mysql.sock‘  port: 3306  Source distribution

140917 15:03:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

/usr/libexec/mysqld: Can‘t create/write to file ‘/tmp/ibEdFc8d‘ (Errcode: 13)

140917 15:03:03  InnoDB: Error: unable to create temporary file; errno: 13

140917 15:03:03 [ERROR] Plugin ‘InnoDB‘ init function returned error.

140917 15:03:03 [ERROR] Plugin ‘InnoDB‘ registration as a STORAGE ENGINE failed.


再查看zabbix的日志之后,也发现报错

[root@czy zabbix]#tail -f /tmp/zabbix_server.log

    

3545:20140917:154534.090 [Z3005] query failed: [1286] Unknown table engine ‘InnoDB‘ [select distinct r.druleid,r.iprange,r.name,c.dcheckid from drules r left join dchecks c on c.druleid=r.druleid and uniq=1 where r.proxy_hostid is null and r.status=0 and (r.nextcheck<=1410939934 or r.nextcheck>1410939934+r.delay) and mod(r.druleid,1)=0 and r.druleid between 0 and 99999999999999]

  3545:20140917:154534.090 [Z3005] query failed: [1286] Unknown table engine ‘InnoDB‘ [select count(*),min(nextcheck) from drules where proxy_hostid is null and status=0 and mod(druleid,1)=0 and druleid between 0 and 99999999999999]


后百度查询“Unknown table engine ‘InnoDB‘”的解决办法,一堆文章说需要修改mysql内部设置调整等,心想不会出现mysql内部设置问题,因为就重启了机器发生的问题。后仔细检查mysql报错,看到关键信息“/usr/libexec/mysqld: Can‘t create/write to file ‘/tmp/ibEdFc8d‘ ”  ,此时查看/tmp的权限,果然是错误的权限,因为机器重启后,/tmp的权限会重置。


解决办法: chmod 777 /tmp


就这样,很简单!  因为Mysql在启动的时候会在/tmp下创建临时文件和 socket 文件,所以/tmp权限不正确了就会报错


本文出自 “Fate” 博客,请务必保留此出处http://czybl.blog.51cto.com/4283444/1554389

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。