MySql problem on ubuntu 16.04












1














It randomly broke yesterday(not starting up any more) and I don't know how to fix it.



When I run:



sudo service mysql start


It gives this error:



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


Output of 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.


Output of 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.









share|improve this question





























    1














    It randomly broke yesterday(not starting up any more) and I don't know how to fix it.



    When I run:



    sudo service mysql start


    It gives this error:



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


    Output of 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.


    Output of 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.









    share|improve this question



























      1












      1








      1







      It randomly broke yesterday(not starting up any more) and I don't know how to fix it.



      When I run:



      sudo service mysql start


      It gives this error:



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


      Output of 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.


      Output of 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.









      share|improve this question















      It randomly broke yesterday(not starting up any more) and I don't know how to fix it.



      When I run:



      sudo service mysql start


      It gives this error:



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


      Output of 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.


      Output of 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.






      16.04 mysql services






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 27 at 10:15









      d a i s y

      3,25982344




      3,25982344










      asked Sep 5 '16 at 13:17









      Bijleveldje

      612




      612






















          1 Answer
          1






          active

          oldest

          votes


















          0














          the systemctl startup script for Mysql is failing to run this command
          /usr/share/mysql/mysql-systemd-start pre



          this doesn't do much other than sanity check your environment using the following shell code :



          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
          }


          if you run it directly via sudo you should get one of those error messages , please follow its suggestions and try again untill it works.



          This isn't a random breakage this is missing files , check the bash_history of the root user and any user who can sudo.






          share|improve this answer





















          • Alright, so it says: MySQL system database not found. Please run mysql_install_db tool. But how would the database be installed, when i changed nothing.
            – Bijleveldje
            Sep 5 '16 at 13:32










          • maybe your var partition failed to mount and so your /var dir is empty
            – Amias
            Sep 5 '16 at 13:34










          • Ah well, when i try to run the installation process again it says: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'.
            – Bijleveldje
            Sep 5 '16 at 13:43










          • Think about it , the server is not running . Its not running because the data has been deleted or the storage containing it is not available to the system in the same way it was at install time.
            – Amias
            Sep 5 '16 at 13:44










          • is there a /var directory and does it have any folders in it ? i'm guessing it wont because it looks like your mount failed.
            – Amias
            Sep 5 '16 at 13:45











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f821233%2fmysql-problem-on-ubuntu-16-04%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          the systemctl startup script for Mysql is failing to run this command
          /usr/share/mysql/mysql-systemd-start pre



          this doesn't do much other than sanity check your environment using the following shell code :



          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
          }


          if you run it directly via sudo you should get one of those error messages , please follow its suggestions and try again untill it works.



          This isn't a random breakage this is missing files , check the bash_history of the root user and any user who can sudo.






          share|improve this answer





















          • Alright, so it says: MySQL system database not found. Please run mysql_install_db tool. But how would the database be installed, when i changed nothing.
            – Bijleveldje
            Sep 5 '16 at 13:32










          • maybe your var partition failed to mount and so your /var dir is empty
            – Amias
            Sep 5 '16 at 13:34










          • Ah well, when i try to run the installation process again it says: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'.
            – Bijleveldje
            Sep 5 '16 at 13:43










          • Think about it , the server is not running . Its not running because the data has been deleted or the storage containing it is not available to the system in the same way it was at install time.
            – Amias
            Sep 5 '16 at 13:44










          • is there a /var directory and does it have any folders in it ? i'm guessing it wont because it looks like your mount failed.
            – Amias
            Sep 5 '16 at 13:45
















          0














          the systemctl startup script for Mysql is failing to run this command
          /usr/share/mysql/mysql-systemd-start pre



          this doesn't do much other than sanity check your environment using the following shell code :



          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
          }


          if you run it directly via sudo you should get one of those error messages , please follow its suggestions and try again untill it works.



          This isn't a random breakage this is missing files , check the bash_history of the root user and any user who can sudo.






          share|improve this answer





















          • Alright, so it says: MySQL system database not found. Please run mysql_install_db tool. But how would the database be installed, when i changed nothing.
            – Bijleveldje
            Sep 5 '16 at 13:32










          • maybe your var partition failed to mount and so your /var dir is empty
            – Amias
            Sep 5 '16 at 13:34










          • Ah well, when i try to run the installation process again it says: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'.
            – Bijleveldje
            Sep 5 '16 at 13:43










          • Think about it , the server is not running . Its not running because the data has been deleted or the storage containing it is not available to the system in the same way it was at install time.
            – Amias
            Sep 5 '16 at 13:44










          • is there a /var directory and does it have any folders in it ? i'm guessing it wont because it looks like your mount failed.
            – Amias
            Sep 5 '16 at 13:45














          0












          0








          0






          the systemctl startup script for Mysql is failing to run this command
          /usr/share/mysql/mysql-systemd-start pre



          this doesn't do much other than sanity check your environment using the following shell code :



          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
          }


          if you run it directly via sudo you should get one of those error messages , please follow its suggestions and try again untill it works.



          This isn't a random breakage this is missing files , check the bash_history of the root user and any user who can sudo.






          share|improve this answer












          the systemctl startup script for Mysql is failing to run this command
          /usr/share/mysql/mysql-systemd-start pre



          this doesn't do much other than sanity check your environment using the following shell code :



          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
          }


          if you run it directly via sudo you should get one of those error messages , please follow its suggestions and try again untill it works.



          This isn't a random breakage this is missing files , check the bash_history of the root user and any user who can sudo.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 5 '16 at 13:28









          Amias

          4,1801228




          4,1801228












          • Alright, so it says: MySQL system database not found. Please run mysql_install_db tool. But how would the database be installed, when i changed nothing.
            – Bijleveldje
            Sep 5 '16 at 13:32










          • maybe your var partition failed to mount and so your /var dir is empty
            – Amias
            Sep 5 '16 at 13:34










          • Ah well, when i try to run the installation process again it says: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'.
            – Bijleveldje
            Sep 5 '16 at 13:43










          • Think about it , the server is not running . Its not running because the data has been deleted or the storage containing it is not available to the system in the same way it was at install time.
            – Amias
            Sep 5 '16 at 13:44










          • is there a /var directory and does it have any folders in it ? i'm guessing it wont because it looks like your mount failed.
            – Amias
            Sep 5 '16 at 13:45


















          • Alright, so it says: MySQL system database not found. Please run mysql_install_db tool. But how would the database be installed, when i changed nothing.
            – Bijleveldje
            Sep 5 '16 at 13:32










          • maybe your var partition failed to mount and so your /var dir is empty
            – Amias
            Sep 5 '16 at 13:34










          • Ah well, when i try to run the installation process again it says: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'.
            – Bijleveldje
            Sep 5 '16 at 13:43










          • Think about it , the server is not running . Its not running because the data has been deleted or the storage containing it is not available to the system in the same way it was at install time.
            – Amias
            Sep 5 '16 at 13:44










          • is there a /var directory and does it have any folders in it ? i'm guessing it wont because it looks like your mount failed.
            – Amias
            Sep 5 '16 at 13:45
















          Alright, so it says: MySQL system database not found. Please run mysql_install_db tool. But how would the database be installed, when i changed nothing.
          – Bijleveldje
          Sep 5 '16 at 13:32




          Alright, so it says: MySQL system database not found. Please run mysql_install_db tool. But how would the database be installed, when i changed nothing.
          – Bijleveldje
          Sep 5 '16 at 13:32












          maybe your var partition failed to mount and so your /var dir is empty
          – Amias
          Sep 5 '16 at 13:34




          maybe your var partition failed to mount and so your /var dir is empty
          – Amias
          Sep 5 '16 at 13:34












          Ah well, when i try to run the installation process again it says: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'.
          – Bijleveldje
          Sep 5 '16 at 13:43




          Ah well, when i try to run the installation process again it says: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'.
          – Bijleveldje
          Sep 5 '16 at 13:43












          Think about it , the server is not running . Its not running because the data has been deleted or the storage containing it is not available to the system in the same way it was at install time.
          – Amias
          Sep 5 '16 at 13:44




          Think about it , the server is not running . Its not running because the data has been deleted or the storage containing it is not available to the system in the same way it was at install time.
          – Amias
          Sep 5 '16 at 13:44












          is there a /var directory and does it have any folders in it ? i'm guessing it wont because it looks like your mount failed.
          – Amias
          Sep 5 '16 at 13:45




          is there a /var directory and does it have any folders in it ? i'm guessing it wont because it looks like your mount failed.
          – Amias
          Sep 5 '16 at 13:45


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f821233%2fmysql-problem-on-ubuntu-16-04%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Ellipse (mathématiques)

          Quarter-circle Tiles

          Mont Emei