(amazon linux)mysql停止ec2重启工作

i7uaboj4  于 2021-06-17  发布在  Mysql
关注(0)|答案(1)|浏览(418)

我的mysql在我的amazon 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。
有人知道为什么它会停止工作吗?

b1zrtrql

b1zrtrql1#

只需重新安装mysql。您不会丢失您的数据库,它们仍将保持原状,并且可以使用与以前相同的用户名/密码进行访问:
这适用于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

相关问题