mysql服务不能启动,解决方法
查看mysql日志时出现以下报错vi/home/mysql/var/localhost.localdomain.err
1604263:07:23 /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
1604263:17:26 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)
1604263:17:26InnoDB: Error: unable to create temporary file; errno: 13
1604263:17:26 Plugin 'InnoDB' init function returned error.
1604263:17:26 Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
1604263:17:26 Can't start server : Bind on unix socket: Permission denied
1604263:17:26 Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
1604263:17:26 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:
$ perror 13
OS error code 13: Permission denied
The solution?
Set the correct owner and permissions to /tmp by running this
commands:
chown root.root /tmp -v
chmod 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:
service mysqld start
Starting mysqld:
页:
[1]