【问题标题】:apt upgrade mysqlserver freezes and will not upgrade (ubuntu server 20.04)apt upgrade mysqlserver 冻结并且不会升级(ubuntu server 20.04)
【发布时间】:2021-04-18 23:04:30
【问题描述】:

我不得不终止会话,然后在我重新启动服务器之前无法访问数据库。

当我重新登录并发出“apt upgrade”时,我收到以下错误。

E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.

我运行“dpkg --configure -a”并得到以下内容,然后它就冻结了

Setting up mysql-server-8.0 (8.0.22-0ubuntu0.20.04.3) ...
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 86150

在另一个 tty 上 journalctl -xe 在升级冻结时给出这个。

-- The unit mysql.service has successfully entered the 'dead' state.
Jan 13 22:18:12 arpradio systemd[1]: Stopped MySQL Community Server.
-- Subject: A stop job for unit mysql.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A stop job for unit mysql.service has finished.
-- 
-- The job identifier is 582 and the job result is done.
Jan 13 22:18:13 arpradio audit[6057]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/usr/sbin/mysqld" pid>
Jan 13 22:18:13 arpradio kernel: audit: type=1400 audit(1610572693.036:16): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="uncon>

当我重新启动并登录时,mysqld 正在运行

我已经尝试了以下方法。

# cp -r /etc/mysql /etc/mysql_old
# apt autoremove
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
# dpkg --configure -a
Setting up mysql-server-8.0 (8.0.22-0ubuntu0.20.04.3) ...
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 7451

我们又回到了这里。

如果我检查 mysql 进程,我发现没有进程 7451,但这是输出。

# ps aux | grep mysql
root        1679  0.0  0.0   8644  4688 ?        Ssl  22:23   0:00 dockerize -template /tmp/db.cnf.tmpl:/etc/mysql/conf.d/db.cnf /usr/local/bin/docker-entrypoint.sh mysqld
systemd+    2526  0.3  0.1 2446780 99836 ?       Sl   22:23   0:03 mysqld
root        7370  0.3  0.0  27940 19836 pts/0    S+   22:38   0:00 /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/mysql-server-8.0.postinst configure 8.0.22-0ubuntu0.20.04.2
root        7379  0.0  0.0   9756  3772 pts/0    S+   22:38   0:00 /bin/bash /var/lib/dpkg/info/mysql-server-8.0.postinst configure 8.0.22-0ubuntu0.20.04.2
mysql       7657  1.9  0.5 1869164 358336 pts/0  Sl+  22:39   0:01 mysqld --user=mysql --init-file=/var/lib/mysql-files/tmp.gQukBE7GtT --socket=/tmp/tmp.KUFQmDDseF/mysqld.sock --pid-file=/tmp/tmp.KUFQmDDseF/mysqld.pid
root        7759  0.0  0.0   9032   724 pts/1    S+   22:39   0:00 grep --color=auto mysql

我检查了mysql.service的状态

# systemctl status mysql.service 
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Wed 2021-01-13 22:38:59 CET; 17min ago
    Process: 649 ExecStart=/usr/sbin/mysqld (code=exited, status=0/SUCCESS)
   Main PID: 649 (code=exited, status=0/SUCCESS)
     Status: "Server shutdown complete"

Jan 13 22:21:43 arpradio systemd[1]: Starting MySQL Community Server...
Jan 13 22:21:45 arpradio systemd[1]: Started MySQL Community Server.
Jan 13 22:38:57 arpradio systemd[1]: Stopping MySQL Community Server...
Jan 13 22:38:59 arpradio systemd[1]: mysql.service: Succeeded.
Jan 13 22:38:59 arpradio systemd[1]: Stopped MySQL Community Server.

【问题讨论】:

  • 你有多少数据?你从哪个版本升级?转换数据可能需要一些时间。另外,某些版本不能跳过,请查看升级手册。
  • 我不确定我从什么升级,但现在是 8.0.22-0ubuntu0.20.04.3。我已经解决了这个问题,我认为数据库大小不是问题,我昨晚把它放在了一夜,它仍然挂在那里。

标签: mysql ubuntu-20.04


【解决方案1】:

我修复了它,我所做的是在升级挂起时运行

apt 更新 && apt 升级

在另一个 tty 上,它升级了所有内容,重新启动,重新启动后我再次检查,一切看起来都很好。

# apt update
Hit:1 http://asi-fs-n.contabo.net/ubuntu focal InRelease
Hit:2 http://asi-fs-n.contabo.net/ubuntu focal-updates InRelease                                                                                                                 
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease                                                                                                                           
Hit:4 https://download.docker.com/linux/ubuntu focal InRelease                                                                                                                   
Hit:5 http://asi-fs-n.contabo.net/ubuntu focal-backports InRelease                               
Get:6 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Fetched 109 kB in 1s (112 kB/s)               
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
root@arpradio:~# apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@arpradio:~# ps aux | grep mysql
mysql        657  1.2  0.6 2067208 378684 ?      Ssl  23:09   0:02 /usr/sbin/mysqld
root        2148  0.1  0.0   9796  4784 ?        Ssl  23:11   0:00 dockerize -template /tmp/db.cnf.tmpl:/etc/mysql/conf.d/db.cnf /usr/local/bin/docker-entrypoint.sh mysqld
systemd+    2930  0.8  0.1 2380944 99508 ?       Sl   23:11   0:00 mysqld
root        5507  0.0  0.0   9032   732 pts/0    S+   23:12   0:00 grep --color=auto mysql
root@arpradio:~# systemctl status mysql.service 
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2021-01-13 23:09:06 CET; 3min 26s ago
    Process: 560 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
   Main PID: 657 (mysqld)
     Status: "Server is operational"
      Tasks: 38 (limit: 72284)
     Memory: 419.9M
     CGroup: /system.slice/mysql.service
             └─657 /usr/sbin/mysqld

Jan 13 23:09:04 arpradio systemd[1]: Starting MySQL Community Server...
Jan 13 23:09:06 arpradio systemd[1]: Started MySQL Community Server.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-25
    • 2020-11-19
    • 2020-09-04
    • 2021-10-14
    • 2020-08-09
    • 2020-08-21
    相关资源
    最近更新 更多