一、mysql无法启动(绝招:perror)
[ERROR] /usr/local/mysql/libexec/mysqld: Can't create/write to file '/usr/local/mysql/test.pid' (Errcode: 13) |
test#/usr/local/mysql/bin/perror 13 Permission denied |
test#chown -R mysql:mysql /usr/local/mysql |
二、mysql无法启动(绝招:more XXX.err)
Starting mysqld daemon with databases from /var/lib/mysql STOPPING server from pid file /var/lib/mysql/test.pid mysqld ended |
test#more /usr/local/mysql/test.err ...... File './test-bin.000001' not found (Errcode: 13) [ERROR] Could not use yejr-bin for logging (error 13). Turning logging off for the whole duration of the MySQL To turn it on again: fix the cause, shutdown the MySQL server and restart it. [ERROR] Aborting [Note] /usr/libexec/mysqld: Shutdown complete ...... |
不过这次是要创建binlog。这时候,我们需要先确定是否需要开启 binlog,如果系统的I/O负载不是很高,而且没有完善的备份机制情况下,建议还是开启binlog,至少作为一种应急备份机制。如果不需要开启,我们只需要在 my.cnf 中把类似以下2行注释掉:
#log-bin = xxx #binlog-format = xxx |
总结:在你不知道该怎么办的时候,第一件事,就是查看 xxx.err 文件,然后把该文件最新部分的内容提供给你要询问的人,以方便他们帮助你解决问题。