环境centos6.5 mysql版本是5.5.10
开启mysql服务
/etc/init.d/mysqld start
报错如下:Starting MySQL.The server quit without updating PID file (/[FAILED]ql/cc.pid).
我的错误日志是/data/mysql/cc.err:
160418 09:33:10 mysqld_safe Starting mysqld daemon with databases from /data/mysql
160418 9:33:10 InnoDB: The InnoDB memory heap is disabled
160418 9:33:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160418 9:33:10 InnoDB: Compressed tables use zlib 1.2.3
/usr/local/mysql/bin/mysqld: Can't create/write to file '/tmp/iblXxbUK' (Errcode: 13)
160418 9:33:10 InnoDB: Error: unable to create temporary file; errno: 13
160418 9:33:10 [ERROR] Plugin 'InnoDB' init function returned error.
160418 9:33:10 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160418 9:33:10 [ERROR] Unknown/unsupported storage engine: InnoDB
160418 9:33:10 [ERROR] Aborting
160418 9:33:10 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
160418 09:33:10 mysqld_safe mysqld from pid file /data/mysql/cc.pid ended
我注意到了这个情况:/tmp这个临时文件目录下不能写文件看来是权限配置错误了
/usr/local/mysql/bin/mysqld: Can't create/write to file '/tmp/iblXxbUK' (Errcode: 13)
果然错误了:
[root@cc /]# ls -ld /tmp
drwxrwxr-x. 4 root root 4096 Apr 18 09:37 /tmp
修改:[root@cc /]# chmod 1777 /tmp
重新启动mysql:[root@cc /]# /etc/init.d/mysqld start
Starting MySQL.. [ OK ]