首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >systemd[1]:安装MySQL -mysql时启动mysql社区服务器失败

systemd[1]:安装MySQL -mysql时启动mysql社区服务器失败
EN

Stack Overflow用户
提问于 2020-03-10 23:09:47
回答 1查看 4.8K关注 0票数 3

当我尝试重新安装mysql时,出现以下错误:

代码语言:javascript
复制
sudo apt-get install mysql-server
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias       
Leyendo la información de estado... Hecho
mysql-server ya está en su versión más reciente (8.0.19-1debian10).
Los paquetes indicados a continuación se instalaron de forma automática y ya no son necesarios.
  galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl
  libdbd-mysql-perl libdbi-perl libfcgi-perl libhtml-template-perl
  libreadline5 libterm-readkey-perl rsync socat
Utilice «sudo apt autoremove» para eliminarlos.
0 actualizados, 0 nuevos se instalarán, 0 para eliminar y 179 no actualizados.
2 no instalados del todo o eliminados.
Se utilizarán 0 B de espacio de disco adicional después de esta operación.
¿Desea continuar? [S/n] s
Configurando mysql-community-server (8.0.19-1debian10) ...
Failed to preset unit: File mysql.service: Link has been severed
/usr/bin/deb-systemd-helper: error: systemctl preset failed on mysql.service: No such file or directory
[mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.
[mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.
[mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.
Failed to get unit file state for mysql.service: Link has been severed
mysql.service is a disabled or a static unit, not starting it.
Job for mysql.service failed because the control process exited with error code.
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; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2020-03-10 12:00:58 -03; 15ms ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 7906 ExecStartPre=/usr/share/mysql-8.0/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
  Process: 7941 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
 Main PID: 7941 (code=exited, status=1/FAILURE)
   Status: "Data Dictionary upgrade from MySQL 5.7 in progress"

mar 10 12:00:56 azeroth systemd[1]: Starting MySQL Community Server...
mar 10 12:00:58 azeroth systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
mar 10 12:00:58 azeroth systemd[1]: mysql.service: Failed with result 'exit-code'.
mar 10 12:00:58 azeroth systemd[1]: Failed to start MySQL Community Server.
dpkg: error al procesar el paquete mysql-community-server (--configure):
 el subproceso instalado paquete mysql-community-server script post-installation devolvió el código de salida de error 1
dpkg: problemas de dependencias impiden la configuración de mysql-server:
 mysql-server depende de mysql-community-server (= 8.0.19-1debian10); sin embargo:
 El paquete `mysql-community-server' no está configurado todavía.

dpkg: error al procesar el paquete mysql-server (--configure):
 problemas de dependencias - se deja sin configurar
Se encontraron errores al procesar:
 mysql-community-server
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

我只知道它和smysql社区有关,其他的就没有了。我已经尝试了这里列出的所有方法:https://askubuntu.com/questions/1008298/cant-start-mysql-server-database-corruption,但都不起作用。

此外: journalctl -xe还提供:

代码语言:javascript
复制
-- Support: https://www.debian.org/support
-- 
-- A start job for unit mysql.service has begun execution.
-- 
-- The job identifier is 2279.
mar 10 17:39:49 azeroth systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- An ExecStart= process belonging to unit mysql.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
mar 10 17:39:49 azeroth systemd[1]: mysql.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit mysql.service has entered the 'failed' state with result 'exit-code'.
mar 10 17:39:49 azeroth systemd[1]: Failed to start MySQL Community Server.
-- Subject: A start job for unit mysql.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit mysql.service has finished with a failure.
-- 
-- The job identifier is 2279 and the job result is failed.
mar 10 17:39:49 azeroth sudo[2743]: pam_unix(sudo:session): session closed for user root
mar 10 17:41:51 azeroth sudo[2805]:  jenifer : TTY=pts/0 ; PWD=/home/jenifer ; USER=root ; COMMAND=/usr/bin/journalctl -xe
mar 10 17:41:51 azeroth sudo[2805]: pam_unix(sudo:session): session opened for user root by (uid=0)

我已经尝试删除mysql-server并使用apt-get重新安装它,但它给出了相同的错误。如果有人能帮助我,我将不胜感激。

EN

回答 1

Stack Overflow用户

发布于 2020-06-26 01:51:01

你可以解决这一部分:

代码语言:javascript
复制
[mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.
[mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.
[mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.

通过编辑mysql.conf文件并替换

代码语言:javascript
复制
/var/run/mysqld

代码语言:javascript
复制
/run/mysqld
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60620443

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档