我进行了 release-upgrade,升级后,我的 mysql 服务器出现了问题。我的服务器看起来正常并且正在运行,但实际上并没有:

systemctl status mysql.service

● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: activating (start) since Wed 2020-07-01 14:01:37 EEST; 377ms ago
     Process: 4546 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Main PID: 4554 (mysqld)
    Status: "Server startup in progress"
    Tasks: 1 (limit: 6840)
    Memory: 125.5M
    CGroup: /system.slice/mysql.service
         └─4554 /usr/sbin/mysqld

Jul 01 14:01:37 microserver systemd[1]: Starting MySQL Community Server...

运行以下命令后:

netstat -an|grep LIST|grep 3306 

这里什么也没有听。

cat /etc/mysql/my.cnf 
[mysqld]

* 基本设置

user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking

当我尝试启动 mysql 服务器时出现以下错误:

root@microserver:~# service mysql start
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.

ps ax|grep mysql
9716 ?        Ssl    0:01 /usr/sbin/mysqld
9744 pts/0    S+     0:00 grep --color=auto mysql

当我尝试连接时:

ps ax|grep mysql
9716 ?        Ssl    0:01 /usr/sbin/mysqld
9744 pts/0    S+     0:00 grep --color=auto mysql

我已完全卸载并清除所有内容并再次安装,但仍然无法运行该服务。

答案1

为什么不尝试找出它没有运行的原因,检查错误状态的日志:

sudo systemctl status mysql.service
sudo journalctl -xe

相关内容