Problema MySQL no Ubuntu 16.04

Problema MySQL no Ubuntu 16.04

Ele quebrou aleatoriamente ontem (não inicia mais) e não sei como consertar.

Quando corro:

sudo service mysql start

Dá 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.

Responder1

o script de inicialização systemctl para Mysql não está conseguindo executar este comando /usr/share/mysql/mysql-systemd-start pre

isso não faz muito além de verificar a sanidade do seu ambiente usando o seguinte código 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ê executá-lo 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, estão faltando arquivos, verifique o bash_history do usuário root e de qualquer usuário que possa sudo.

informação relacionada