Shutdown Hangs on “A stop job is running to for Mysql Community Server” on Ubuntu 16.04.2 LTS











up vote
11
down vote

favorite
7












I'm using Mysql ver 14.14 Distrib 5.7.17, for Linux (x86_64). Whenever i shutdown Ubuntu, it hangs here.



enter image description here



After 10 minutes, it automatically kills the process (my guess). I ran into this problem many times, i did a clean install a few times, it works for a while but then start doing the same thing after a few proper shutdowns.



Pressing Ctrl+Alt+Del 7 times consecutively forces a shutdown. Forcing shutdown like this corrupted my Mysql data. Does anyone ran into this problem? I'm using Ubuntu Ubuntu 16.04.2 LTS.










share|improve this question


















  • 2




    Same here. Thanks for ask this question.
    – Matěj Kříž
    Apr 25 '17 at 16:33










  • What happens when you run sudo service mysql stop on the command line? Maybe some script needs some intervention when shutting down the MySQL server.
    – Patrick
    Jul 19 at 15:22















up vote
11
down vote

favorite
7












I'm using Mysql ver 14.14 Distrib 5.7.17, for Linux (x86_64). Whenever i shutdown Ubuntu, it hangs here.



enter image description here



After 10 minutes, it automatically kills the process (my guess). I ran into this problem many times, i did a clean install a few times, it works for a while but then start doing the same thing after a few proper shutdowns.



Pressing Ctrl+Alt+Del 7 times consecutively forces a shutdown. Forcing shutdown like this corrupted my Mysql data. Does anyone ran into this problem? I'm using Ubuntu Ubuntu 16.04.2 LTS.










share|improve this question


















  • 2




    Same here. Thanks for ask this question.
    – Matěj Kříž
    Apr 25 '17 at 16:33










  • What happens when you run sudo service mysql stop on the command line? Maybe some script needs some intervention when shutting down the MySQL server.
    – Patrick
    Jul 19 at 15:22













up vote
11
down vote

favorite
7









up vote
11
down vote

favorite
7






7





I'm using Mysql ver 14.14 Distrib 5.7.17, for Linux (x86_64). Whenever i shutdown Ubuntu, it hangs here.



enter image description here



After 10 minutes, it automatically kills the process (my guess). I ran into this problem many times, i did a clean install a few times, it works for a while but then start doing the same thing after a few proper shutdowns.



Pressing Ctrl+Alt+Del 7 times consecutively forces a shutdown. Forcing shutdown like this corrupted my Mysql data. Does anyone ran into this problem? I'm using Ubuntu Ubuntu 16.04.2 LTS.










share|improve this question













I'm using Mysql ver 14.14 Distrib 5.7.17, for Linux (x86_64). Whenever i shutdown Ubuntu, it hangs here.



enter image description here



After 10 minutes, it automatically kills the process (my guess). I ran into this problem many times, i did a clean install a few times, it works for a while but then start doing the same thing after a few proper shutdowns.



Pressing Ctrl+Alt+Del 7 times consecutively forces a shutdown. Forcing shutdown like this corrupted my Mysql data. Does anyone ran into this problem? I'm using Ubuntu Ubuntu 16.04.2 LTS.







16.04 mysql






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 11 '17 at 16:59









Waleed Ahmad

166116




166116








  • 2




    Same here. Thanks for ask this question.
    – Matěj Kříž
    Apr 25 '17 at 16:33










  • What happens when you run sudo service mysql stop on the command line? Maybe some script needs some intervention when shutting down the MySQL server.
    – Patrick
    Jul 19 at 15:22














  • 2




    Same here. Thanks for ask this question.
    – Matěj Kříž
    Apr 25 '17 at 16:33










  • What happens when you run sudo service mysql stop on the command line? Maybe some script needs some intervention when shutting down the MySQL server.
    – Patrick
    Jul 19 at 15:22








2




2




Same here. Thanks for ask this question.
– Matěj Kříž
Apr 25 '17 at 16:33




Same here. Thanks for ask this question.
– Matěj Kříž
Apr 25 '17 at 16:33












What happens when you run sudo service mysql stop on the command line? Maybe some script needs some intervention when shutting down the MySQL server.
– Patrick
Jul 19 at 15:22




What happens when you run sudo service mysql stop on the command line? Maybe some script needs some intervention when shutting down the MySQL server.
– Patrick
Jul 19 at 15:22










7 Answers
7






active

oldest

votes

















up vote
4
down vote













Before shutting down your system, try running this to manually shut down the mysql service.



sudo service mysql stop


Alternatively, write a script to automate the process:



sudo service mysql stop
sudo shutdown -h now


Make sure to mark it as executable. Presuming you saved it as a file named shutdown, run this command:



chmod u+x shutdown


Now you can execute your script.



./shutdown





share|improve this answer



















  • 4




    If MySql server hangs on shutdown, it will also hang on service mysql stop command. Right approach here is to investigate why MySql server hangs.
    – Vitaliy
    Apr 13 at 10:35




















up vote
3
down vote













Thats because you got problems with timezone settings:




Got the same issue, found a possible explanation: my cloud provider store time in local timezone (earlier than UTC); at startup MySQL boot first, then NTP, which updates the time to UTC; therefore, MySQL literally "started in the future" (sounds interesting).




Running sudo dpkg-reconfigure tzdata should do the trick



Source: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1600164/comments/11






share|improve this answer




























    up vote
    1
    down vote













    Install mysql-client with



    apt-get install mysql-client


    That should be sufficient.






    share|improve this answer










    New contributor




    Frank Verbeke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      up vote
      0
      down vote













      This happens to me to when I changed the hostname with :



      $ sudo hostnamectl set-hostname my-new-hostname



      without stopping the mysql server.






      share|improve this answer




























        up vote
        0
        down vote













        Shut down the pc using command- sudo init 0
        Though this sounds stupid but yes, it works. It worked for me and even for you too. Actually the server does not stopped because of not being getting the super administrative privileges. So next time shut down using this command.






        share|improve this answer




























          up vote
          0
          down vote













          If it helps anyone else, this is what has resolved the issue for me on Ubuntu 16.04 LTS. Basically delayed the service startup in the mysql.service file under /lib/systemd/system/
          I added
          After=lightdm.service and wants=lightdm.service.
          (My lightdm.service is itself delayed until domain authentication has taken place)
          I guess you could use any other service that you know will start later on in the boot. These service files will also shutdown the services when Ubuntu is shutdown in the reverse order.






          share|improve this answer




























            up vote
            0
            down vote













            I tried running sudo apt-get install mysql*, and after the installation finished everything seems to be working nice and easy now... Both following the user680697's nice idea and also shutting down or restarting using GUI capabilities(I'm on Ubuntu Mate 16.04).






            share|improve this answer





















              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',
              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%2f892026%2fshutdown-hangs-on-a-stop-job-is-running-to-for-mysql-community-server-on-ubunt%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              7 Answers
              7






              active

              oldest

              votes








              7 Answers
              7






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              4
              down vote













              Before shutting down your system, try running this to manually shut down the mysql service.



              sudo service mysql stop


              Alternatively, write a script to automate the process:



              sudo service mysql stop
              sudo shutdown -h now


              Make sure to mark it as executable. Presuming you saved it as a file named shutdown, run this command:



              chmod u+x shutdown


              Now you can execute your script.



              ./shutdown





              share|improve this answer



















              • 4




                If MySql server hangs on shutdown, it will also hang on service mysql stop command. Right approach here is to investigate why MySql server hangs.
                – Vitaliy
                Apr 13 at 10:35

















              up vote
              4
              down vote













              Before shutting down your system, try running this to manually shut down the mysql service.



              sudo service mysql stop


              Alternatively, write a script to automate the process:



              sudo service mysql stop
              sudo shutdown -h now


              Make sure to mark it as executable. Presuming you saved it as a file named shutdown, run this command:



              chmod u+x shutdown


              Now you can execute your script.



              ./shutdown





              share|improve this answer



















              • 4




                If MySql server hangs on shutdown, it will also hang on service mysql stop command. Right approach here is to investigate why MySql server hangs.
                – Vitaliy
                Apr 13 at 10:35















              up vote
              4
              down vote










              up vote
              4
              down vote









              Before shutting down your system, try running this to manually shut down the mysql service.



              sudo service mysql stop


              Alternatively, write a script to automate the process:



              sudo service mysql stop
              sudo shutdown -h now


              Make sure to mark it as executable. Presuming you saved it as a file named shutdown, run this command:



              chmod u+x shutdown


              Now you can execute your script.



              ./shutdown





              share|improve this answer














              Before shutting down your system, try running this to manually shut down the mysql service.



              sudo service mysql stop


              Alternatively, write a script to automate the process:



              sudo service mysql stop
              sudo shutdown -h now


              Make sure to mark it as executable. Presuming you saved it as a file named shutdown, run this command:



              chmod u+x shutdown


              Now you can execute your script.



              ./shutdown






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Apr 21 '17 at 4:30









              Zanna

              49k13123234




              49k13123234










              answered Apr 21 '17 at 3:04









              user680697

              412




              412








              • 4




                If MySql server hangs on shutdown, it will also hang on service mysql stop command. Right approach here is to investigate why MySql server hangs.
                – Vitaliy
                Apr 13 at 10:35
















              • 4




                If MySql server hangs on shutdown, it will also hang on service mysql stop command. Right approach here is to investigate why MySql server hangs.
                – Vitaliy
                Apr 13 at 10:35










              4




              4




              If MySql server hangs on shutdown, it will also hang on service mysql stop command. Right approach here is to investigate why MySql server hangs.
              – Vitaliy
              Apr 13 at 10:35






              If MySql server hangs on shutdown, it will also hang on service mysql stop command. Right approach here is to investigate why MySql server hangs.
              – Vitaliy
              Apr 13 at 10:35














              up vote
              3
              down vote













              Thats because you got problems with timezone settings:




              Got the same issue, found a possible explanation: my cloud provider store time in local timezone (earlier than UTC); at startup MySQL boot first, then NTP, which updates the time to UTC; therefore, MySQL literally "started in the future" (sounds interesting).




              Running sudo dpkg-reconfigure tzdata should do the trick



              Source: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1600164/comments/11






              share|improve this answer

























                up vote
                3
                down vote













                Thats because you got problems with timezone settings:




                Got the same issue, found a possible explanation: my cloud provider store time in local timezone (earlier than UTC); at startup MySQL boot first, then NTP, which updates the time to UTC; therefore, MySQL literally "started in the future" (sounds interesting).




                Running sudo dpkg-reconfigure tzdata should do the trick



                Source: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1600164/comments/11






                share|improve this answer























                  up vote
                  3
                  down vote










                  up vote
                  3
                  down vote









                  Thats because you got problems with timezone settings:




                  Got the same issue, found a possible explanation: my cloud provider store time in local timezone (earlier than UTC); at startup MySQL boot first, then NTP, which updates the time to UTC; therefore, MySQL literally "started in the future" (sounds interesting).




                  Running sudo dpkg-reconfigure tzdata should do the trick



                  Source: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1600164/comments/11






                  share|improve this answer












                  Thats because you got problems with timezone settings:




                  Got the same issue, found a possible explanation: my cloud provider store time in local timezone (earlier than UTC); at startup MySQL boot first, then NTP, which updates the time to UTC; therefore, MySQL literally "started in the future" (sounds interesting).




                  Running sudo dpkg-reconfigure tzdata should do the trick



                  Source: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1600164/comments/11







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 16 '17 at 18:56









                  Titenis

                  311




                  311






















                      up vote
                      1
                      down vote













                      Install mysql-client with



                      apt-get install mysql-client


                      That should be sufficient.






                      share|improve this answer










                      New contributor




                      Frank Verbeke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.






















                        up vote
                        1
                        down vote













                        Install mysql-client with



                        apt-get install mysql-client


                        That should be sufficient.






                        share|improve this answer










                        New contributor




                        Frank Verbeke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.




















                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          Install mysql-client with



                          apt-get install mysql-client


                          That should be sufficient.






                          share|improve this answer










                          New contributor




                          Frank Verbeke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          Install mysql-client with



                          apt-get install mysql-client


                          That should be sufficient.







                          share|improve this answer










                          New contributor




                          Frank Verbeke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          share|improve this answer



                          share|improve this answer








                          edited Nov 20 at 22:16









                          zx485

                          1,43831114




                          1,43831114






                          New contributor




                          Frank Verbeke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered Nov 20 at 17:58









                          Frank Verbeke

                          111




                          111




                          New contributor




                          Frank Verbeke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          Frank Verbeke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          Frank Verbeke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






















                              up vote
                              0
                              down vote













                              This happens to me to when I changed the hostname with :



                              $ sudo hostnamectl set-hostname my-new-hostname



                              without stopping the mysql server.






                              share|improve this answer

























                                up vote
                                0
                                down vote













                                This happens to me to when I changed the hostname with :



                                $ sudo hostnamectl set-hostname my-new-hostname



                                without stopping the mysql server.






                                share|improve this answer























                                  up vote
                                  0
                                  down vote










                                  up vote
                                  0
                                  down vote









                                  This happens to me to when I changed the hostname with :



                                  $ sudo hostnamectl set-hostname my-new-hostname



                                  without stopping the mysql server.






                                  share|improve this answer












                                  This happens to me to when I changed the hostname with :



                                  $ sudo hostnamectl set-hostname my-new-hostname



                                  without stopping the mysql server.







                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered May 18 at 7:05









                                  Gabriel Glenn

                                  1287




                                  1287






















                                      up vote
                                      0
                                      down vote













                                      Shut down the pc using command- sudo init 0
                                      Though this sounds stupid but yes, it works. It worked for me and even for you too. Actually the server does not stopped because of not being getting the super administrative privileges. So next time shut down using this command.






                                      share|improve this answer

























                                        up vote
                                        0
                                        down vote













                                        Shut down the pc using command- sudo init 0
                                        Though this sounds stupid but yes, it works. It worked for me and even for you too. Actually the server does not stopped because of not being getting the super administrative privileges. So next time shut down using this command.






                                        share|improve this answer























                                          up vote
                                          0
                                          down vote










                                          up vote
                                          0
                                          down vote









                                          Shut down the pc using command- sudo init 0
                                          Though this sounds stupid but yes, it works. It worked for me and even for you too. Actually the server does not stopped because of not being getting the super administrative privileges. So next time shut down using this command.






                                          share|improve this answer












                                          Shut down the pc using command- sudo init 0
                                          Though this sounds stupid but yes, it works. It worked for me and even for you too. Actually the server does not stopped because of not being getting the super administrative privileges. So next time shut down using this command.







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Jun 21 at 11:31









                                          Vikramsingh Kushwaha

                                          1




                                          1






















                                              up vote
                                              0
                                              down vote













                                              If it helps anyone else, this is what has resolved the issue for me on Ubuntu 16.04 LTS. Basically delayed the service startup in the mysql.service file under /lib/systemd/system/
                                              I added
                                              After=lightdm.service and wants=lightdm.service.
                                              (My lightdm.service is itself delayed until domain authentication has taken place)
                                              I guess you could use any other service that you know will start later on in the boot. These service files will also shutdown the services when Ubuntu is shutdown in the reverse order.






                                              share|improve this answer

























                                                up vote
                                                0
                                                down vote













                                                If it helps anyone else, this is what has resolved the issue for me on Ubuntu 16.04 LTS. Basically delayed the service startup in the mysql.service file under /lib/systemd/system/
                                                I added
                                                After=lightdm.service and wants=lightdm.service.
                                                (My lightdm.service is itself delayed until domain authentication has taken place)
                                                I guess you could use any other service that you know will start later on in the boot. These service files will also shutdown the services when Ubuntu is shutdown in the reverse order.






                                                share|improve this answer























                                                  up vote
                                                  0
                                                  down vote










                                                  up vote
                                                  0
                                                  down vote









                                                  If it helps anyone else, this is what has resolved the issue for me on Ubuntu 16.04 LTS. Basically delayed the service startup in the mysql.service file under /lib/systemd/system/
                                                  I added
                                                  After=lightdm.service and wants=lightdm.service.
                                                  (My lightdm.service is itself delayed until domain authentication has taken place)
                                                  I guess you could use any other service that you know will start later on in the boot. These service files will also shutdown the services when Ubuntu is shutdown in the reverse order.






                                                  share|improve this answer












                                                  If it helps anyone else, this is what has resolved the issue for me on Ubuntu 16.04 LTS. Basically delayed the service startup in the mysql.service file under /lib/systemd/system/
                                                  I added
                                                  After=lightdm.service and wants=lightdm.service.
                                                  (My lightdm.service is itself delayed until domain authentication has taken place)
                                                  I guess you could use any other service that you know will start later on in the boot. These service files will also shutdown the services when Ubuntu is shutdown in the reverse order.







                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Jul 19 at 14:50









                                                  Rob

                                                  1




                                                  1






















                                                      up vote
                                                      0
                                                      down vote













                                                      I tried running sudo apt-get install mysql*, and after the installation finished everything seems to be working nice and easy now... Both following the user680697's nice idea and also shutting down or restarting using GUI capabilities(I'm on Ubuntu Mate 16.04).






                                                      share|improve this answer

























                                                        up vote
                                                        0
                                                        down vote













                                                        I tried running sudo apt-get install mysql*, and after the installation finished everything seems to be working nice and easy now... Both following the user680697's nice idea and also shutting down or restarting using GUI capabilities(I'm on Ubuntu Mate 16.04).






                                                        share|improve this answer























                                                          up vote
                                                          0
                                                          down vote










                                                          up vote
                                                          0
                                                          down vote









                                                          I tried running sudo apt-get install mysql*, and after the installation finished everything seems to be working nice and easy now... Both following the user680697's nice idea and also shutting down or restarting using GUI capabilities(I'm on Ubuntu Mate 16.04).






                                                          share|improve this answer












                                                          I tried running sudo apt-get install mysql*, and after the installation finished everything seems to be working nice and easy now... Both following the user680697's nice idea and also shutting down or restarting using GUI capabilities(I'm on Ubuntu Mate 16.04).







                                                          share|improve this answer












                                                          share|improve this answer



                                                          share|improve this answer










                                                          answered Nov 1 at 14:41









                                                          Tower

                                                          28111




                                                          28111






























                                                               

                                                              draft saved


                                                              draft discarded



















































                                                               


                                                              draft saved


                                                              draft discarded














                                                              StackExchange.ready(
                                                              function () {
                                                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f892026%2fshutdown-hangs-on-a-stop-job-is-running-to-for-mysql-community-server-on-ubunt%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

                                                              flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                                                              Mangá

                                                              Eduardo VII do Reino Unido