title: mysql.service: Main process exited, code=exited, status=1/FAILURE
body: <p>i cannot start my mysql server, it crashed all a sudden and i can not find any useful log to say why.</p>
  
  <p>my disk has still some space left, several Gigabytes.</p>
  
  <p>last logs from <code>journalctl -feu mysql</code> are like this, which doesnt help at all:</p>
  
  <pre><code>May 06 16:04:23 soy systemd[1]: Starting MySQL Community Server... 
  May 06 16:04:23 soy su[5927]: Successful su for mysql by root 
  May 06 16:04:23 soy su[5927]: + ??? root:mysql 
  May 06 16:04:23 soy su[5927]: pam_unix(su:session): session opened for user mysql by (uid=0) 
  May 06 16:04:23 soy su[5927]: pam_unix(su:session): session closed for user mysql 
  May 06 16:04:24 soy systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE 
  May 06 16:04:24 soy systemd[1]: mysql.service: Failed with result 'exit-code'. May 06 16:04:24 soy systemd[1]: Failed to start MySQL Community Server.
  </code></pre>
  
  <p>mysql version 8
  mysql  Ver 8.0.20 for Linux on x86_64 (MySQL Community Server - GPL)
  Linux soy 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux</p>
  
  <pre><code>lsb_release -a
  </code></pre>
  
  <p>No LSB modules are available.
  Distributor ID: Ubuntu
  Description:    Ubuntu 18.04.4 LTS
  Release:    18.04
  Codename:   bionic</p>
  
  <p>and here the service info: </p>
  
  <pre><code>service mysql status 
  
  ● mysql.service - MySQL Community Server    Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)    Active: failed (Result: exit-code) since Wed 2020-05-06 16:04:24 UTC; 7min ago
       Docs: man:mysqld(8)
             http://dev.mysql.com/doc/refman/en/using-systemd.html   Process: 5961 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)   Process: 5876 ExecStartPre=/usr/share/mysql-8.0/mysql-systemd-start pre (code=exited, status=0/SUCCESS)  Main PID: 5961 (code=exited, status=1/FAILURE)    Status: "Server startup in progress"
  
  May 06 16:04:23 soy systemd[1]: Starting MySQL Community Server... 
  May 06 16:04:23 soy su[5927]: Successful su for mysql by root 
  May 06 16:04:23 soy su[5927]: + ??? root:mysql 
  May 06 16:04:23 soy su[5927]: pam_unix(su:session): session opened for user mysql by (uid=0) 
  May 06 16:04:23 soy su[5927]: pam_unix(su:session): session closed for user mysql 
  May 06 16:04:24 soy systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE 
  May 06 16:04:24 soy systemd[1]: mysql.service: Failed with result 'exit-code'. 
  May 06 16:04:24 soy systemd[1]: Failed to start MySQL Community Server.
  </code></pre>
  
  <p>error log:</p>
  
  <blockquote>
    <p>020-05-07T07:55:44.761003Z 0 [System] [MY-013169] [Server]
    /usr/sbin/mysqld (mysqld 8.0.20) initializing of server in progress as
    process 2024 2020-05-07T07:55:44.762802Z 0 [ERROR] [MY-010457]
    [Server] --initialize specified but the data directory has files in
    it. Aborting. 2020-05-07T07:55:44.762827Z 0 [ERROR] [MY-013236]
    [Server] The designated data directory /var/lib/mysql/ is unusable.
    You can remove all files that the server added to it.
    2020-05-07T07:55:44.762887Z 0 [ERROR] [MY-010119] [Server] Aborting
    2020-05-07T07:55:44.762984Z 0 [System] [MY-010910] [Server]
    /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20)  MySQL Community
    Server - GPL. 2020-05-07T07:55:45.026958Z 0 [System] [MY-010116]
    [Server] /usr/sbin/mysqld (mysqld 8.0.20) starting as process 2032
    2020-05-07T07:55:45.041675Z 1 [ERROR] [MY-011011] [Server] Failed to
    find valid data directory. 2020-05-07T07:55:45.041828Z 0 [ERROR]
    [MY-010020] [Server] Data Dictionary initialization failed.
    2020-05-07T07:55:45.041889Z 0 [ERROR] [MY-010119] [Server] Aborting
    2020-05-07T07:55:45.042277Z 0 [System] [MY-010910] [Server]
    /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20)  MySQL Community
    Server - GPL. 2020-05-07T07:55:45.298208Z 0 [System] [MY-010116]
    [Server] /usr/sbin/mysqld (mysqld 8.0.20) starting as process 2040
    2020-05-07T07:55:45.305008Z 1 [ERROR] [MY-011011] [Server] Failed to
    find valid data directory. 2020-05-07T07:55:45.305180Z 0 [ERROR]
    [MY-010020] [Server] Data Dictionary initialization failed.
    2020-05-07T07:55:45.305248Z 0 [ERROR] [MY-010119] [Server] Aborting
    2020-05-07T07:55:45.305563Z 0 [System] [MY-010910] [Server]
    /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20)  MySQL Community
    Server - GPL.</p>
  </blockquote>
  
  <p>it says it cannot create a test file, but i have no idea why.
  maybe unattended-upgrades broken rights.
  the var/lib/mysql folder is owned by mysql user and group. so no idea why it couldnt make files in here.
  thats really tricky.</p>