(Amazon Linux)MySQL 在 EC2 重启时停止工作
(Amazon Linux) MySQL stops working on EC2 reboot
我的 MySQL 在我的亚马逊 Linux 上突然停止工作,这是我的命令的输出:
[ec2-user@ip-10-0-0-16 log]$ sudo service mysqld start
Redirecting to /bin/systemctl start mysqld.service
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
[ec2-user@ip-10-0-0-16 log]$ systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Tue 2018-12-11 03:44:10 UTC; 3s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 5558 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 5540 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: Failed to start MySQL Server.
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: Unit mysqld.service entered failed state.
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: mysqld.service failed.
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: mysqld.service holdoff time over, scheduling restart.
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: start request repeated too quickly for mysqld.service
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: Failed to start MySQL Server.
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: Unit mysqld.service entered failed state.
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: mysqld.service failed.
我不明白,为什么mysql突然就停止工作并进入失败状态?
我还确保 /var/log/mysql 存在,它的所有权是 mysql:mysql,并且 CHMOD 权限是 755。
有谁知道为什么它会那样停止工作?
只需重新安装 MySQL。您不会丢失您的数据库,它们仍将完好无损,并且可以通过与以前相同的 username/passwords 访问:
这适用于亚马逊 Linux:
$ sudo yum -y remove mysql-server
$ wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
$ sudo yum localinstall mysql57-community-release-el7-8.noarch.rpm
$ sudo yum install mysql-community-server
$ sudo service mysqld start
我的 MySQL 在我的亚马逊 Linux 上突然停止工作,这是我的命令的输出:
[ec2-user@ip-10-0-0-16 log]$ sudo service mysqld start
Redirecting to /bin/systemctl start mysqld.service
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
[ec2-user@ip-10-0-0-16 log]$ systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Tue 2018-12-11 03:44:10 UTC; 3s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 5558 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 5540 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: Failed to start MySQL Server.
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: Unit mysqld.service entered failed state.
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: mysqld.service failed.
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: mysqld.service holdoff time over, scheduling restart.
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: start request repeated too quickly for mysqld.service
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: Failed to start MySQL Server.
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: Unit mysqld.service entered failed state.
Dec 11 03:44:10 ip-10-0-0-16.ec2.internal systemd[1]: mysqld.service failed.
我不明白,为什么mysql突然就停止工作并进入失败状态?
我还确保 /var/log/mysql 存在,它的所有权是 mysql:mysql,并且 CHMOD 权限是 755。
有谁知道为什么它会那样停止工作?
只需重新安装 MySQL。您不会丢失您的数据库,它们仍将完好无损,并且可以通过与以前相同的 username/passwords 访问:
这适用于亚马逊 Linux:
$ sudo yum -y remove mysql-server
$ wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
$ sudo yum localinstall mysql57-community-release-el7-8.noarch.rpm
$ sudo yum install mysql-community-server
$ sudo service mysqld start