Linux 上的 MySQL 问题和 100% CPU 负载

Linux 上的 MySQL 问题和 100% CPU 负载

我在 Ubuntu 20.04 上。
为什么在我删除这个包的同时,系统正在启动相关服务?

我需要此服务器上的 MySQL。我应该如何正确执行其安装程序?

root@myhost:~# apt remove mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  mysql-server
0 upgraded, 0 newly installed, 1 to remove and 97 not upgraded.
2 not fully installed or removed.
After this operation, 112 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 46943 files and directories currently installed.)
Removing mysql-server (8.0.22-0ubuntu0.20.04.3) ...
Setting up mysql-server-8.0 (8.0.22-0ubuntu0.20.04.3) ...
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/log/mysql/error.log
2021-01-27T16:04:12.673791Z 0 [ERROR] [MY-011065] [Server] Unable to determine if daemon is running: No such file or directory (rc=0).
2021-01-27T16:04:12.681639Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
Warning: Unable to start the server.
Job for mysql.service failed because a fatal signal was delivered to the control process.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: signal) since Wed 2021-01-27 16:04:16 UTC; 93ms ago
    Process: 2128 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 2136 ExecStart=/usr/sbin/mysqld (code=killed, signal=KILL)
   Main PID: 2136 (code=killed, signal=KILL)
     Status: "Server startup in progress"

Jan 27 16:04:16 myhost systemd[1]: mysql.service: Main process exited, code=killed, status=9/KILL
Jan 27 16:04:16 myhost systemd[1]: mysql.service: Failed with result 'signal'.
Jan 27 16:04:16 myhost systemd[1]: Failed to start MySQL Community Server.
Jan 27 16:04:16 myhost systemd[1]: mysql.service: Scheduled restart job, restart counter is at 1.
Jan 27 16:04:16 myhost systemd[1]: Stopped MySQL Community Server.
Jan 27 16:04:16 myhost systemd[1]: Starting MySQL Community Server...
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 mysql-server-8.0
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

是的。问题出在我的 RAM 数量上。我的 RAM 是 512 MB。

没有明确的要求,并且这些日志没有以简单的方式显示这一点。

无论如何。我在我的服务器上启用了交换分区。现在一切都运行正常。非常感谢 <3

相关内容