51Testing软件测试论坛

标题: 【转载】mysql服务不能启动,解决方法 [打印本页]

作者: lsekfe    时间: 2016-4-27 14:45
标题: 【转载】mysql服务不能启动,解决方法

查看mysql日志时出现以下报错

vi  /home/mysql/var/localhost.localdomain.err
160426  3:07:23 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete

160426 03:07:23 mysqld_safe mysqld from pid file /home/mysql/var/localhost.localdomain.pid ended
160426 03:17:25 mysqld_safe Starting mysqld daemon with databases from /home/mysql/var
160426  3:17:26 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
^G/usr/local/mysql/libexec/mysqld: Can't create/write to file '/tmp/ib1yAlZB' (Errcode: 13)
160426  3:17:26  InnoDB: Error: unable to create temporary file; errno: 13
160426  3:17:26 [ERROR] Plugin 'InnoDB' init function returned error.
160426  3:17:26 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160426  3:17:26 [ERROR] Can't start server : Bind on unix socket: Permission denied
160426  3:17:26 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
160426  3:17:26 [ERROR] Aborting

Can’t create/write to file ‘/tmp/’ (Errcode: 13)

So, let’s see what an error 13 really means:

perror 13

And we see it’s a permission denied error:

[my@server ~]$ perror 13OS error code 13: Permission denied

The solution?

Set the correct owner and permissions to /tmp by running this commands:

chown root.root /tmp -vchmod 1777 /tmp -v

Now restart MySQL to test it:

/etc/init.d/mysqld start

That’s all, now your MySQL server should be able to start without any warnings or failures:

[my@server:~]service mysqld startStarting mysqld:                                      
本文出自 “脚踏实地向前行” 博客http://343614597.blog.51cto.com/7056394/1767653

作者: Miss_love    时间: 2016-4-27 17:12
学习。。。。




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2