1.查看mysql状态,报错如下:

MySQL is running but PID file could not be found

查询日志发现如下提示:

mysqld_safe mysqld from pid file /usr/local/mysql/data/centos.pid ended

解决方法:初始化mysql

/usr/local/mysql/bin/mysql_install_db –user=mysql

2.mysql无法启动,查看日志:

/usr/local/mysql/libexec/mysqld: Disk is full writing ‘./mysql-bin.~rec~’ (Errcode: 28). Waiting for someone to free space… (Expect up to 60 secs delay for server to continue after freeing disk space)

清理磁盘空间,重启OK!