Ubuntu 16.04의 MySQL 문제

Ubuntu 16.04의 MySQL 문제

어제 무작위로 고장이 났고(더 이상 시작되지 않음) 어떻게 해결해야 할지 모르겠습니다.

내가 실행할 때 :

sudo service mysql start

다음과 같은 오류가 발생합니다.

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

출력 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.

출력 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.

답변1

Mysql의 systemctl 시작 스크립트가 /usr/share/mysql/mysql-systemd-start pre 명령을 실행하지 못합니다.

이는 다음 쉘 코드를 사용하여 환경을 확인하는 것 외에는 많은 작업을 수행하지 않습니다.

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
}

sudo를 통해 직접 실행하면 해당 오류 메시지 중 하나가 표시됩니다. 제안 사항을 따르고 작동할 때까지 다시 시도하세요.

이것은 파일이 누락된 무작위 파손이 아닙니다. 루트 사용자와 sudo를 수행할 수 있는 모든 사용자의 bash_history를 확인하세요.

관련 정보