我无法使用systemctl start mysql.service
命令在 Ubuntu 18.04 上重新启动 mysql。重启服务器后突然发生这种情况。
我在日志文件中看到这一行:
mysqld:无法确定守护进程是否正在运行:没有此文件或目录
如何解决这个问题?
其结果journalctl -xe -u mysql.service
是:
Jul 14 16:36:49 cloud systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has begun starting up.
Jul 14 16:36:50 cloud mysqld[28159]: Unable to determine if daemon is running: No such file or directory
Jul 14 16:36:50 cloud systemd[1]: mysql.service: Control process exited, code=exited status=1
Jul 14 16:36:50 cloud systemd[1]: mysql.service: Failed with result 'exit-code'.
Jul 14 16:36:50 cloud systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has failed.
--
-- The result is RESULT.
Jul 14 16:36:50 cloud systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Jul 14 16:36:50 cloud systemd[1]: mysql.service: Scheduled restart job, restart counter is at 1.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit mysql.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jul 14 16:36:50 cloud systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has finished shutting down.
Jul 14 16:36:50 cloud systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
结果如下sudo less /var/log/mysql/error.log
:
2021-07-14T16:36:50.074477Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more detai
ls).
2021-07-14T16:36:50.078158Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.34-0ubuntu0.18.04.1) starting as process 28161 ...
2021-07-14T16:36:50.095869Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-07-14T16:36:50.095891Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-07-14T16:36:50.095895Z 0 [Note] InnoDB: Uses event mutexes
2021-07-14T16:36:50.095898Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-07-14T16:36:50.095901Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-07-14T16:36:50.095908Z 0 [Note] InnoDB: Using Linux native AIO
2021-07-14T16:36:50.106135Z 0 [Note] InnoDB: Number of pools: 1
2021-07-14T16:36:50.108649Z 0 [Note] InnoDB: Using CPU crc32 instructions
2021-07-14T16:36:50.110883Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-07-14T16:36:50.129232Z 0 [Note] InnoDB: Completed initialization of buffer pool
2021-07-14T16:36:50.135317Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-07-14T16:36:50.159838Z 0 [ERROR] InnoDB: Database page corruption on disk or a failed file read of page [page id: space=0, page number=5]. You may have to recover from a backup.
2021-07-14T16:36:50.159862Z 0 [Note] InnoDB: Page dump in ascii and hex (16384 bytes):
len 16384; hex 36301e4a000000050000000000000000000000003ba6516200....