错误信息 :
//查看mysql状态
[root@master ~]# systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since 一 2019-1-19 22:13:21 CST; 38s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 6764 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 6746 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
1月 19 22:13:21 master systemd[1]: Failed to start MySQL Server.
问题原因:由于个人电脑一共256的硬盘容量只还剩余100G磁盘给虚拟机分了18g,虚拟机磁盘容量被占满导致mysql服务异常
通过查看mysql日志发现报了磁盘被占满的错误(mysql启动不起来问题可以通过查看日志定位具体问题再做后期的处理)
// mysql的日志位置 /var/log/mysqld.log
[root@master log]# tail -100f mysqld.log
==> mysqld.log <==
2019-10-19T14:29:37.938853Z 9083 [Note] Aborted connection 9083 to db: 'paramconcat' user: 'root' host: '192.168.225.200' (Got an error reading communication packets)
communication packets)
2019-1-19T14:29:57.149598Z 9090 [ERROR] Disk is full writing '/var/lib/mysql/mysql-bin.000005' (Errcode: 15756208 - No space left on device). Waiting for someone to free space...
2019-1-19T14:29:57.149631Z 9090 [ERROR] Retry in 60 secs. Message reprinted in 600 secs
[root@master log]# df -lh
文件系统 容量 已用 可用 已用% 挂载点
/dev/sda2 15G 15G 0 100% /
devtmpfs 980M 0 980M 0% /dev
tmpfs 991M 0 991M 0% /dev/shm
tmpfs 991M 9.5M 981M 1% /run
tmpfs 991M 0 991M 0% /sys/fs/cgroup
/dev/sda1 3.0G 114M 4.5G 3% /boot
tmpfs 199M 0 199M 0% /run/user/0
问题解决:删除历史的一些占用空间大的没用的数据,比如历史日志(若有用也可导出,无论如何能达到释放磁盘空间的作用就可以)。再次启动mysql可以正常启动了。
[root@master var]# systemctl start mysqld
[root@master var]# systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since 一 2019-1-19 22:23:46 CST; 5s ago