我的数据库今天停止工作,我不知道为什么,它给我的唯一响应是:
● mysqld.service - LSB: start and stop MySQL
Loaded: loaded (/etc/init.d/mysqld; generated)
Active: failed (Result: exit-code) since Tue 2022-08-16 17:31:24 UTC; 30s ago
Docs: man:systemd-sysv-generator(8)
Process: 4680 ExecStart=/etc/init.d/mysqld start (code=exited, status=1/FAILURE)
Aug 16 17:31:21 kdymsolucoes.dev.br systemd[1]: Starting LSB: start and stop MySQL...
Aug 16 17:31:24 kdymsolucoes.dev.br mysqld[4680]: Starting MySQL... * The server quit without updating PID file (/www/server/data/kdymsolucoes.dev.br.pid).
Aug 16 17:31:24 kdymsolucoes.dev.br systemd[1]: mysqld.service: Control process exited, code=exited, status=1/FAILURE
Aug 16 17:31:24 kdymsolucoes.dev.br systemd[1]: mysqld.service: Failed with result 'exit-code'.
Aug 16 17:31:24 kdymsolucoes.dev.br systemd[1]: Failed to start LSB: start and stop MySQL.
我重新启动了服务器,重新安装了它,但似乎什么都不起作用。
以下是journalctl -xe
:的输出
-- An ExecStart= process belonging to unit mysqld.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Aug 16 17:31:24 kdymsolucoes.dev.br systemd[1]: mysqld.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit mysqld.service has entered the 'failed' state with result 'exit-code'.
Aug 16 17:31:24 kdymsolucoes.dev.br systemd[1]: Failed to start LSB: start and stop MySQL.
-- Subject: A start job for unit mysqld.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit mysqld.service has finished with a failure.
--
-- The job identifier is 1593 and the job result is failed.
Aug 16 17:31:58 kdymsolucoes.dev.br sshd[5471]: Invalid user jake from 113.57.170.50 port 37434
Aug 16 17:31:58 kdymsolucoes.dev.br sshd[5471]: pam_unix(sshd:auth): check pass; user unknown
Aug 16 17:31:58 kdymsolucoes.dev.br sshd[5471]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=113.57.170.50
Aug 16 17:32:01 kdymsolucoes.dev.br CRON[5475]: pam_unix(cron:session): session opened for user root by (uid=0)
Aug 16 17:32:01 kdymsolucoes.dev.br CRON[5476]: (root) CMD (/root/-)
Aug 16 17:32:01 kdymsolucoes.dev.br sendmail[5477]: 27GHW1nS005477: from=root, size=324, class=0, nrcpts=1, msgid=<202208161732.27GHW1nS005477@kdymsolucoes.d>Aug 16 17:32:01 kdymsolucoes.dev.br sm-mta[5478]: 27GHW1Fv005478: from=<root@kdymsolucoes.dev.br>, size=600, class=0, nrcpts=1, msgid=<202208161732.27GHW1nS0>Aug 16 17:32:01 kdymsolucoes.dev.br sendmail[5477]: 27GHW1nS005477: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30324, re>Aug 16 17:32:01 kdymsolucoes.dev.br CRON[5475]: pam_unix(cron:session): session closed for user root
Aug 16 17:32:01 kdymsolucoes.dev.br sshd[5471]: Failed password for invalid user jake from 113.57.170.50 port 37434 ssh2
Aug 16 17:32:01 kdymsolucoes.dev.br sm-mta[5479]: 27GHW1Fv005478: to=<root@kdymsolucoes.dev.br>, ctladdr=<root@kdymsolucoes.dev.br> (0/0), delay=00:00:00, xd>Aug 16 17:32:03 kdymsolucoes.dev.br sshd[5471]: Received disconnect from 113.57.170.50 port 37434:11: Bye Bye [preauth]
Aug 16 17:32:03 kdymsolucoes.dev.br sshd[5471]: Disconnected from invalid user jake 113.57.170.50 port 37434 [preauth]
Aug 16 17:33:01 kdymsolucoes.dev.br CRON[5572]: pam_unix(cron:session): session opened for user root by (uid=0)
Aug 16 17:33:01 kdymsolucoes.dev.br CRON[5573]: (root) CMD (/root/-)
Aug 16 17:33:01 kdymsolucoes.dev.br sendmail[5574]: 27GHX1g2005574: from=root, size=324, class=0, nrcpts=1, msgid=<202208161733.27GHX1g2005574@kdymsolucoes.d>Aug 16 17:33:01 kdymsolucoes.dev.br sm-mta[5576]: 27GHX1kx005576: from=<root@kdymsolucoes.dev.br>, size=600, class=0, nrcpts=1, msgid=<202208161733.27GHX1g20>Aug 16 17:33:01 kdymsolucoes.dev.br sendmail[5574]: 27GHX1g2005574: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30324, re>Aug 16 17:33:01 kdymsolucoes.dev.br CRON[5572]: pam_unix(cron:session): session closed for user root
Aug 16 17:33:01 kdymsolucoes.dev.br sm-mta[5577]: 27GHX1kx005576: to=<root@kdymsolucoes.dev.br>, ctladdr=<root@kdymsolucoes.dev.br> (0/0), delay=00:00:00, xd>Aug 16 17:33:14 kdymsolucoes.dev.br sshd[5586]: Invalid user server from 223.75.51.167 port 45114
Aug 16 17:33:14 kdymsolucoes.dev.br sshd[5586]: pam_unix(sshd:auth): check pass; user unknown
Aug 16 17:33:14 kdymsolucoes.dev.br sshd[5586]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=223.75.51.167
Aug 16 17:33:16 kdymsolucoes.dev.br sshd[5586]: Failed password for invalid user server from 223.75.51.167 port 45114 ssh2
Aug 16 17:33:16 kdymsolucoes.dev.br sshd[5586]: Received disconnect from 223.75.51.167 port 45114:11: Bye Bye [preauth]
Aug 16 17:33:16 kdymsolucoes.dev.br sshd[5586]: Disconnected from invalid user server 223.75.51.167 port 45114 [preauth]
Aug 16 17:34:01 kdymsolucoes.dev.br CRON[5588]: pam_unix(cron:session): session opened for user root by (uid=0)
Aug 16 17:34:01 kdymsolucoes.dev.br CRON[5589]: (root) CMD (/root/-)
Aug 16 17:34:01 kdymsolucoes.dev.br sendmail[5590]: 27GHY1sZ005590: from=root, size=324, class=0, nrcpts=1, msgid=<202208161734.27GHY1sZ005590@kdymsolucoes.d>Aug 16 17:34:01 kdymsolucoes.dev.br sm-mta[5591]: 27GHY1WQ005591: from=<root@kdymsolucoes.dev.br>, size=600, class=0, nrcpts=1, msgid=<202208161734.27GHY1sZ0>Aug 16 17:34:01 kdymsolucoes.dev.br sendmail[5590]: 27GHY1sZ005590: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30324, re>Aug 16 17:34:01 kdymsolucoes.dev.br CRON[5588]: pam_unix(cron:session): session closed for user root
Aug 16 17:34:01 kdymsolucoes.dev.br sm-mta[5592]: 27GHY1WQ005591: to=<root@kdymsolucoes.dev.br>, ctladdr=<root@kdymsolucoes.dev.br> (0/0), delay=00:00:00, xd>Aug 16 17:34:36 kdymsolucoes.dev.br sshd[5600]: Invalid user ubuntu from 223.75.51.167 port 17031
Aug 16 17:34:36 kdymsolucoes.dev.br sshd[5600]: pam_unix(sshd:auth): check pass; user unknown
Aug 16 17:34:36 kdymsolucoes.dev.br sshd[5600]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=223.75.51.167
Aug 16 17:34:37 kdymsolucoes.dev.br sshd[5600]: Failed password for invalid user ubuntu from 223.75.51.167 port 17031 ssh2
Aug 16 17:34:39 kdymsolucoes.dev.br sshd[5600]: Received disconnect from 223.75.51.167 port 17031:11: Bye Bye [preauth]
Aug 16 17:34:39 kdymsolucoes.dev.br sshd[5600]: Disconnected from invalid user ubuntu 223.75.51.167 port 17031 [preauth]
它只是提供了与status命令相同的输出。
我用8天前的备份解决了这个问题。我从/var/lib/mysql
下载了这些文件,并将其复制到有一个正常工作的mysql服务器的备份中。我不得不解决几个错误和权限,但可以通过不断检查/var/log/mysql/errors.log
来解决它们。
感谢@halfer帮我找到了的方法