Reputation: 1273
My MySQL on my Amazon Linux all-of-a-sudden stopped working, here is the output of my commands:
[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.
I don't understand, why would mysql all-of-a-sudden just stop working like that and enter a failed state?
I also made sure that /var/log/mysql exists, it's ownership is mysql:mysql, and that the CHMOD rights are 755.
Does anyone know why it would just stop working like that?
Upvotes: -1
Views: 2697
Reputation: 1273
Just re-install MySQL. You won't lose your databases, they will still be in tact and can be accessed by the same username/passwords as before:
This works for Amazon 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
Upvotes: 1