Problema no MySql no Ubuntu 16.04

1

Ele quebrou aleatoriamente ontem (não começou mais) e eu não sei como consertar isso.

Quando eu corro:

sudo service mysql start

Isso gera esse erro:

Job for mysql.service failed because the control process exited with error 
code. See "systemctl status mysql.service" and "journalctl -xe" for details.

Saída de systemctl status mysql.service :

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)<br>
   Active: inactive (dead) (Result: exit-code) since Mon 2016-09-05 15:10:31 CEST; 43s ago<br>
  Process: 6515 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)<br>
Sep 05 15:10:31 vps310084 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.<br>
Sep 05 15:10:31 vps310084 systemd[1]: Stopped MySQL Community Server.<br>
Sep 05 15:10:31 vps310084 systemd[1]: mysql.service: Start request repeated too quickly.<br>
Sep 05 15:10:31 vps310084 systemd[1]: Failed to start MySQL Community Server.<br>
Sep 05 15:10:33 vps310084 systemd[1]: mysql.service: Start request repeated too quickly.<br>
Sep 05 15:10:33 vps310084 systemd[1]: Failed to start MySQL Community Server.

Saída de journalctl -xe :

Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel**
--
-- Unit mysql.service has failed.
--
-- The result is failed. 
Sep 05 15:14:56 vps310084 systemd[1]: mysql.service: Unit entered failed state. 
Sep 05 15:14:56 vps310084 systemd[1]: mysql.service: Failed with result 'exit-code'.
Sep 05 15:14:56 vps310084 systemd[1]: mysql.service: Service hold-off time over, scheduling restart. 
Sep 05 15:14:56 vps310084 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down<br>
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has finished shutting down. 
Sep 05 15:14:56 vps310084 systemd[1]: mysql.service: Start request repeated too quickly. 
Sep 05 15:14:56 vps310084 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
--
-- Unit mysql.service has failed.
--
-- The result is failed.
    
por Bijleveldje 05.09.2016 / 15:17

1 resposta

0

o script de inicialização systemctl para o MySQL está falhando ao executar este comando / usr / share / mysql / mysql-systemd-start pre

isso não faz muito além de sanidade verificar seu ambiente usando o seguinte código de shell:

sanity () {
  if [ ! -r /etc/mysql/my.cnf ]; then
    echo "MySQL configuration not found at /etc/mysql/my.cnf. Please create one."
    exit 1
  fi

  if [ ! -d /var/lib/mysql ] && [ ! -L /var/lib/mysql ]; then
    echo "MySQL data dir not found at /var/lib/mysql. Please create one."
    exit 1
  fi

  if [ ! -d /var/lib/mysql/mysql ] && [ ! -L /var/lib/mysql/mysql ]; then
    echo "MySQL system database not found. Please run mysql_install_db tool."
    exit 1
  fi
}

Se você o executar diretamente via sudo, deverá receber uma dessas mensagens de erro, siga as sugestões e tente novamente até que funcione.

Esta não é uma quebra aleatória em falta de arquivos, verifique o bash_history do usuário root e qualquer usuário que possa sudo.

    
por Amias 05.09.2016 / 15:28