从Ubuntu 18.04升级到20.04后启动MySQL服务器时出现问题

cotxawn7  于 2023-02-28  发布在  Mysql
关注(0)|答案(1)|浏览(302)

从Ubuntu 18. 04升级到20. 04(MySQL 5. 7到8)后,我在启动MySQL时遇到了问题。当我试图启动MySQL服务工具包时,它停在“启动MySQL社区服务器..."。

USER@SERVER:~$ 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-08-19 11:38:13 CEST; 576ms ago
    Process: 18006 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
   Main PID: 18014 (mysqld)
     Status: "Server startup in progress"
      Tasks: 13 (limit: 1110)
     Memory: 261.6M
     CGroup: /system.slice/mysql.service
             └─18014 /usr/sbin/mysqld

Aug 19 11:38:13 SERVER systemd[1]: Starting MySQL Community Server...

日记给了我以下的信息。

USER@SERVER:~$ journalctl -xe

--
-- The job identifier is 24060.
Aug 19 11:38:17 boris-dev systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit mysql.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Aug 19 11:38:17 boris-dev systemd[1]: mysql.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit mysql.service has entered the 'failed' state with result 'exit-code'.
Aug 19 11:38:17 boris-dev systemd[1]: Failed to start MySQL Community Server.
-- Subject: A start job for unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit mysql.service has finished with a failure.
--
-- The job identifier is 24060 and the job result is failed.
Aug 19 11:38:17 boris-dev systemd[1]: mysql.service: Scheduled restart job, restart counter is at 139.
-- 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.
Aug 19 11:38:17 boris-dev 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 24126 and the job result is done.
Aug 19 11:38:17 boris-dev systemd[1]: Starting MySQL Community Server...
-- Subject: A start job for unit mysql.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit mysql.service has begun execution.
--
-- The job identifier is 24126.

有几个数据库,保留它们会很好,但不是必要的。
你知道怎么做最好吗?
先谢了

2ledvvac

2ledvvac1#

我在将服务器从Ubuntu 18.04.6 LTS升级到Ubuntu 20.04.5 LTS时遇到了同样的问题。解决方案是从配置文件中删除两行。
文件名:/etc/mysql/my.cnf
注解:

查询缓存限制= 1M

查询缓存大小= 16M

服务器升级包括升级到MySQL 8,其中一些变量已弃用,包括query_cache_limit和query_cache_size。
来源:https://serverfault.com/a/1042328/1006560

相关问题