服务器无法确定守护进程是否正在运行。

5
大家好! 我在Linux Ubuntu Server 20.04.2 LTS上安装MySQL 8.0服务器时遇到了问题。
我需要在Linux Ubuntu Server 20.04.2 LTS上安装此版本的mysql-server8.0.23
我已尝试过:
  1. https://www.youtube.com/watch?v=pQoUvmtq3_U&ab_channel=BeGeek - 这是一个关于在Ubuntu上安装MySQL的视频教程。
  2. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) - 错误2002(HY000):无法通过套接字'/var/run/mysqld/mysqld.sock'(2)连接到本地MySQL服务器。
  3. https://askubuntu.com/questions/643251/having-trouble-installing-and-removing-mysql-in-ubuntu - 我在Ubuntu上安装和卸载MySQL时遇到了问题,该怎么办?
  4. https://askubuntu.com/questions/1267636/cant-install-mysql-server-on-ubuntu-20-04-1-due-to-several-errors - 由于多个错误,我无法在Ubuntu 20.04.1上安装MySQL服务器,该怎么办?
  5. MySQL my.cnf file - Found option without preceding group - MySQL my.cnf文件-发现没有前导组的选项。
  6. https://askubuntu.com/questions/797312/either-mysql-wont-start-or-the-client-shows-error-found-option-without-precedi - MySQL要么无法启动,要么客户端显示错误“找到没有前置组的选项”。
  7. https://serverfault.com/questions/305053/mysqld-sock-doesnt-exist - mysqld.sock不存在,该怎么办?
  8. https://unix.stackexchange.com/questions/33433/font-encoding-in-terminal - 终端中的字体编码问题。
  9. https://linuxhint.com/install_mysql_ubuntu_2004/ - 在Ubuntu 20.04上安装MySQL的步骤。
  10. 我尝试创建缺失的文件,但这并没有帮助解决问题。
我有一台全新的VDS,使用纯净的Ubuntu服务器20.04.2 LTS,里面没有任何内容。
日志:Putty。
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (8.0.25-0ubuntu0.20.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-8.0 (8.0.25-0ubuntu0.20.04.1) ...
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/log/mysql/error.log
2021-07-11T10:29:44.109433Z 0 [ERROR] [MY-011065] [Server] Unable to determine if daemon is running: No such file or directory (rc=0).
2021-07-11T10:29:44.117954Z 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 Sun 2021-07-11 13:29:46 MSK; 44ms ago
    Process: 10254 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 10271 ExecStart=/usr/sbin/mysqld (code=killed, signal=KILL)
   Main PID: 10271 (code=killed, signal=KILL)
     Status: "Server startup in progress"

Jul 11 13:29:46 vm2107059480 systemd[1]: mysql.service: Main process exited, code=killed, status=9/KILL
Jul 11 13:29:46 vm2107059480 systemd[1]: mysql.service: Failed with result 'signal'.
Jul 11 13:29:46 vm2107059480 systemd[1]: Failed to start 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
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 mysql-server-8.0
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

日志:/var/log/mysql/error.log

2021-07-11T10:29:42.768169Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-11T10:29:46.023486Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25-0ubuntu0.20.04.1) starting as process 10271
2021-07-11T10:29:46.151047Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-11T10:29:47.681827Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25-0ubuntu0.20.04.1) starting as process 10290
2021-07-11T10:29:47.776960Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-11T10:29:53.765476Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25-0ubuntu0.20.04.1) starting as process 10356
2021-07-11T10:29:58.511612Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-11T10:30:59.292200Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25-0ubuntu0.20.04.1) starting as process 10386
2021-07-11T10:30:59.758603Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-11T10:31:01.640829Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25-0ubuntu0.20.04.1) starting as process 10421
2021-07-11T10:31:01.695269Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-11T10:31:02.905736Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25-0ubuntu0.20.04.1) starting as process 10443
2021-07-11T10:31:02.948849Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-11T10:31:04.145881Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25-0ubuntu0.20.04.1) starting as process 10465
2021-07-11T10:31:04.183083Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-11T10:31:05.051672Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25-0ubuntu0.20.04.1) starting as process 10487
2021-07-11T10:31:05.087005Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

我已经尝试了几天,但仍无法解决问题。有人知道我做错了什么吗?谷歌并没有帮到我。
1个回答

9

我成功了:

开始交换。

dd if=/dev/zero of=/swapfile bs=1M count=1024
mkswap /swapfile
swapon /swapfile
docker start mysql

你能否将你的回答放在问题的背景下?这样更容易理解。 - godidier
@ godidier 可能是机器的空闲 RAM 值很低,而且没有任何交换。 - Binar Web

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接