Shutdown hangs on “A stop job is running to for Mysql Community Server”












11















I'm using MySQL ver 14.14 Distrib 5.7.17 for Linux (x86_64) on Ubuntu 16.04. 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 starts doing the same thing after a few proper shutdowns.



Pressing Ctrl+Alt+Del 7 times consecutively forces a shutdown. Forcing a shutdown like this corrupted my MySQL data. Has anyone else ran into this problem?










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 '18 at 15:22
















11















I'm using MySQL ver 14.14 Distrib 5.7.17 for Linux (x86_64) on Ubuntu 16.04. 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 starts doing the same thing after a few proper shutdowns.



Pressing Ctrl+Alt+Del 7 times consecutively forces a shutdown. Forcing a shutdown like this corrupted my MySQL data. Has anyone else ran into this problem?










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 '18 at 15:22














11












11








11


7






I'm using MySQL ver 14.14 Distrib 5.7.17 for Linux (x86_64) on Ubuntu 16.04. 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 starts doing the same thing after a few proper shutdowns.



Pressing Ctrl+Alt+Del 7 times consecutively forces a shutdown. Forcing a shutdown like this corrupted my MySQL data. Has anyone else ran into this problem?










share|improve this question
















I'm using MySQL ver 14.14 Distrib 5.7.17 for Linux (x86_64) on Ubuntu 16.04. 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 starts doing the same thing after a few proper shutdowns.



Pressing Ctrl+Alt+Del 7 times consecutively forces a shutdown. Forcing a shutdown like this corrupted my MySQL data. Has anyone else ran into this problem?







16.04 mysql shutdown






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 3 hours ago









karel

58k12128146




58k12128146










asked Mar 11 '17 at 16:59









Waleed AhmadWaleed 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 '18 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 '18 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 '18 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 '18 at 15:22










8 Answers
8






active

oldest

votes


















4














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 '18 at 10:35





















3














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































    1














    Install mysql-client with



    apt-get install mysql-client


    That should be sufficient.






    share|improve this answer

































      0














      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































        0














        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































          0














          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































            0














            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































              0














              Strangely enough, this worked for me:



              sudo dpkg-reconfigure tzdata


              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'






              share|improve this answer








              New contributor




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




















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

                Post as a guest















                Required, but never shown

























                8 Answers
                8






                active

                oldest

                votes








                8 Answers
                8






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                4














                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 '18 at 10:35


















                4














                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 '18 at 10:35
















                4












                4








                4







                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

                50.4k13133241




                50.4k13133241










                answered Apr 21 '17 at 3:04









                user680697user680697

                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 '18 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 '18 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 '18 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 '18 at 10:35















                3














                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




























                  3














                  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


























                    3












                    3








                    3







                    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









                    TitenisTitenis

                    311




                    311























                        1














                        Install mysql-client with



                        apt-get install mysql-client


                        That should be sufficient.






                        share|improve this answer






























                          1














                          Install mysql-client with



                          apt-get install mysql-client


                          That should be sufficient.






                          share|improve this answer




























                            1












                            1








                            1







                            Install mysql-client with



                            apt-get install mysql-client


                            That should be sufficient.






                            share|improve this answer















                            Install mysql-client with



                            apt-get install mysql-client


                            That should be sufficient.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Nov 20 '18 at 22:16









                            zx485

                            1,45231114




                            1,45231114










                            answered Nov 20 '18 at 17:58









                            Frank VerbekeFrank Verbeke

                            111




                            111























                                0














                                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




























                                  0














                                  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


























                                    0












                                    0








                                    0







                                    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 '18 at 7:05









                                    Gabriel GlennGabriel Glenn

                                    1287




                                    1287























                                        0














                                        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




























                                          0














                                          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


























                                            0












                                            0








                                            0







                                            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 '18 at 11:31









                                            Vikramsingh KushwahaVikramsingh Kushwaha

                                            1




                                            1























                                                0














                                                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




























                                                  0














                                                  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


























                                                    0












                                                    0








                                                    0







                                                    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 '18 at 14:50









                                                    RobRob

                                                    11




                                                    11























                                                        0














                                                        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




























                                                          0














                                                          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


























                                                            0












                                                            0








                                                            0







                                                            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 '18 at 14:41









                                                            TowerTower

                                                            28111




                                                            28111























                                                                0














                                                                Strangely enough, this worked for me:



                                                                sudo dpkg-reconfigure tzdata


                                                                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'






                                                                share|improve this answer








                                                                New contributor




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

























                                                                  0














                                                                  Strangely enough, this worked for me:



                                                                  sudo dpkg-reconfigure tzdata


                                                                  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'






                                                                  share|improve this answer








                                                                  New contributor




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























                                                                    0












                                                                    0








                                                                    0







                                                                    Strangely enough, this worked for me:



                                                                    sudo dpkg-reconfigure tzdata


                                                                    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'






                                                                    share|improve this answer








                                                                    New contributor




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










                                                                    Strangely enough, this worked for me:



                                                                    sudo dpkg-reconfigure tzdata


                                                                    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'







                                                                    share|improve this answer








                                                                    New contributor




                                                                    Kira02 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






                                                                    New contributor




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









                                                                    answered 4 hours ago









                                                                    Kira02Kira02

                                                                    11




                                                                    11




                                                                    New contributor




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





                                                                    New contributor





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






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






























                                                                        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.




                                                                        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%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

                                                                        GameSpot

                                                                        connect to host localhost port 22: Connection refused

                                                                        Getting a Wifi WPA2 wifi connection