How to kill mysql with moving pid











up vote
0
down vote

favorite












I have multiple mysql instances running on OSX 10.10. /usr/local/mysql/bin/mysqld stop spits out a bunch of warnings and errors, I'm not sure if they're worth sharing. Here's the first error 16164 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. Running mysql_upgrade fails.



Running ps aux | grep mysql results in:



clayton         16179   0.0  0.0  2423356    228 s000  R+   10:58AM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn mysql
_mysql 15599 0.0 0.3 3070756 24508 ?? S 10:22AM 0:01.64 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/Beast.local.err --pid-file=/usr/local/mysql/data/Beast.local.pid
root 15514 0.0 0.0 2452828 876 ?? Ss 10:22AM 0:00.02 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql


I tried kill the processes sudo kill -15 16179 15599 15514, but my user process pid changes. kill: 16179: No such process. If I do ps aux | grep mysql repeatedly the pid of the first process, owned by clayton, jumps up by 10 each time.



So, next I tried to unload mysql using launchctl unload /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist and launchctl unload /Library/LaunchDaemons/com.mysql.mysql.plist result in Could not find specified service.



Ugh. I'm definitely stumped and not sure how to proceed. Any suggestions?










share|improve this question


























    up vote
    0
    down vote

    favorite












    I have multiple mysql instances running on OSX 10.10. /usr/local/mysql/bin/mysqld stop spits out a bunch of warnings and errors, I'm not sure if they're worth sharing. Here's the first error 16164 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. Running mysql_upgrade fails.



    Running ps aux | grep mysql results in:



    clayton         16179   0.0  0.0  2423356    228 s000  R+   10:58AM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn mysql
    _mysql 15599 0.0 0.3 3070756 24508 ?? S 10:22AM 0:01.64 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/Beast.local.err --pid-file=/usr/local/mysql/data/Beast.local.pid
    root 15514 0.0 0.0 2452828 876 ?? Ss 10:22AM 0:00.02 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql


    I tried kill the processes sudo kill -15 16179 15599 15514, but my user process pid changes. kill: 16179: No such process. If I do ps aux | grep mysql repeatedly the pid of the first process, owned by clayton, jumps up by 10 each time.



    So, next I tried to unload mysql using launchctl unload /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist and launchctl unload /Library/LaunchDaemons/com.mysql.mysql.plist result in Could not find specified service.



    Ugh. I'm definitely stumped and not sure how to proceed. Any suggestions?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have multiple mysql instances running on OSX 10.10. /usr/local/mysql/bin/mysqld stop spits out a bunch of warnings and errors, I'm not sure if they're worth sharing. Here's the first error 16164 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. Running mysql_upgrade fails.



      Running ps aux | grep mysql results in:



      clayton         16179   0.0  0.0  2423356    228 s000  R+   10:58AM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn mysql
      _mysql 15599 0.0 0.3 3070756 24508 ?? S 10:22AM 0:01.64 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/Beast.local.err --pid-file=/usr/local/mysql/data/Beast.local.pid
      root 15514 0.0 0.0 2452828 876 ?? Ss 10:22AM 0:00.02 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql


      I tried kill the processes sudo kill -15 16179 15599 15514, but my user process pid changes. kill: 16179: No such process. If I do ps aux | grep mysql repeatedly the pid of the first process, owned by clayton, jumps up by 10 each time.



      So, next I tried to unload mysql using launchctl unload /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist and launchctl unload /Library/LaunchDaemons/com.mysql.mysql.plist result in Could not find specified service.



      Ugh. I'm definitely stumped and not sure how to proceed. Any suggestions?










      share|improve this question













      I have multiple mysql instances running on OSX 10.10. /usr/local/mysql/bin/mysqld stop spits out a bunch of warnings and errors, I'm not sure if they're worth sharing. Here's the first error 16164 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. Running mysql_upgrade fails.



      Running ps aux | grep mysql results in:



      clayton         16179   0.0  0.0  2423356    228 s000  R+   10:58AM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn mysql
      _mysql 15599 0.0 0.3 3070756 24508 ?? S 10:22AM 0:01.64 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/Beast.local.err --pid-file=/usr/local/mysql/data/Beast.local.pid
      root 15514 0.0 0.0 2452828 876 ?? Ss 10:22AM 0:00.02 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql


      I tried kill the processes sudo kill -15 16179 15599 15514, but my user process pid changes. kill: 16179: No such process. If I do ps aux | grep mysql repeatedly the pid of the first process, owned by clayton, jumps up by 10 each time.



      So, next I tried to unload mysql using launchctl unload /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist and launchctl unload /Library/LaunchDaemons/com.mysql.mysql.plist result in Could not find specified service.



      Ugh. I'm definitely stumped and not sure how to proceed. Any suggestions?







      macos mysql process launchctl






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 8 '15 at 15:17









      icicleking

      10815




      10815






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          The process probably is probably respawning each time when you try to kill it.



          You can always try to use pgrep and kill them at one go, e.g.:



          kill $(pgrep mysql)


          But I think the solution would be to find the source where it's get restarted each time, so try checking list of your running/system daemons by using launchctl:



          sudo launchctl list


          Then unload as described in: How do you stop MySQL on a Mac OS install?



          If you've the problem with:




          [ERROR] Can't open the mysql.plugin table.




          probably you're running it wrong, by not specifying the right mysql data directories. So maybe it's worth to load them again via launchctl, check how they were run before, or locate your configuration file and double check the configuration, or you've the wrong permissions set-up.



          Here is sample syntax how you can run it manually:



          mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/var/db/mysql --datadir=/var/db/mysql --plugin-dir=/var/db/mysql/lib/plugin --user=mysql --tmpdir=/tmp/mysql/tmpdir --log-error=/var/log/mysql_error_log.err --pid-file=/tmp/mysql/mysql.pid --socket=/tmp/mysql/mysql.sock --port=3306


          When using MAMP, the command-line parameters looks like:



          /Applications/MAMP/Library/bin/mysqld --defaults-file=/Applications/MAMP/tmp/mysql/my.cnf --basedir=/Applications/MAMP/Library --datadir=/Library/Application Support/appsolute/MAMP PRO/db/mysql --plugin-dir=/Applications/MAMP/Library/lib/plugin --user=mysql --tmpdir=/Applications/MAMP/tmp/mysql/tmpdir --log-error=/Applications/MAMP/logs/mysql_error_log.err --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --socket=/Applications/MAMP/tmp/mysql/mysql.sock --port=3306 





          share|improve this answer






























            up vote
            0
            down vote













            That first line you're seeing is the ps aux | grep mysql command that you're (re-)running each time, so not one to worry about.



            You should be able to kill the mysql process by name if you use sudo pkill mysql.






            share|improve this answer





















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "3"
              };
              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%2fsuperuser.com%2fquestions%2f983969%2fhow-to-kill-mysql-with-moving-pid%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              0
              down vote













              The process probably is probably respawning each time when you try to kill it.



              You can always try to use pgrep and kill them at one go, e.g.:



              kill $(pgrep mysql)


              But I think the solution would be to find the source where it's get restarted each time, so try checking list of your running/system daemons by using launchctl:



              sudo launchctl list


              Then unload as described in: How do you stop MySQL on a Mac OS install?



              If you've the problem with:




              [ERROR] Can't open the mysql.plugin table.




              probably you're running it wrong, by not specifying the right mysql data directories. So maybe it's worth to load them again via launchctl, check how they were run before, or locate your configuration file and double check the configuration, or you've the wrong permissions set-up.



              Here is sample syntax how you can run it manually:



              mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/var/db/mysql --datadir=/var/db/mysql --plugin-dir=/var/db/mysql/lib/plugin --user=mysql --tmpdir=/tmp/mysql/tmpdir --log-error=/var/log/mysql_error_log.err --pid-file=/tmp/mysql/mysql.pid --socket=/tmp/mysql/mysql.sock --port=3306


              When using MAMP, the command-line parameters looks like:



              /Applications/MAMP/Library/bin/mysqld --defaults-file=/Applications/MAMP/tmp/mysql/my.cnf --basedir=/Applications/MAMP/Library --datadir=/Library/Application Support/appsolute/MAMP PRO/db/mysql --plugin-dir=/Applications/MAMP/Library/lib/plugin --user=mysql --tmpdir=/Applications/MAMP/tmp/mysql/tmpdir --log-error=/Applications/MAMP/logs/mysql_error_log.err --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --socket=/Applications/MAMP/tmp/mysql/mysql.sock --port=3306 





              share|improve this answer



























                up vote
                0
                down vote













                The process probably is probably respawning each time when you try to kill it.



                You can always try to use pgrep and kill them at one go, e.g.:



                kill $(pgrep mysql)


                But I think the solution would be to find the source where it's get restarted each time, so try checking list of your running/system daemons by using launchctl:



                sudo launchctl list


                Then unload as described in: How do you stop MySQL on a Mac OS install?



                If you've the problem with:




                [ERROR] Can't open the mysql.plugin table.




                probably you're running it wrong, by not specifying the right mysql data directories. So maybe it's worth to load them again via launchctl, check how they were run before, or locate your configuration file and double check the configuration, or you've the wrong permissions set-up.



                Here is sample syntax how you can run it manually:



                mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/var/db/mysql --datadir=/var/db/mysql --plugin-dir=/var/db/mysql/lib/plugin --user=mysql --tmpdir=/tmp/mysql/tmpdir --log-error=/var/log/mysql_error_log.err --pid-file=/tmp/mysql/mysql.pid --socket=/tmp/mysql/mysql.sock --port=3306


                When using MAMP, the command-line parameters looks like:



                /Applications/MAMP/Library/bin/mysqld --defaults-file=/Applications/MAMP/tmp/mysql/my.cnf --basedir=/Applications/MAMP/Library --datadir=/Library/Application Support/appsolute/MAMP PRO/db/mysql --plugin-dir=/Applications/MAMP/Library/lib/plugin --user=mysql --tmpdir=/Applications/MAMP/tmp/mysql/tmpdir --log-error=/Applications/MAMP/logs/mysql_error_log.err --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --socket=/Applications/MAMP/tmp/mysql/mysql.sock --port=3306 





                share|improve this answer

























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  The process probably is probably respawning each time when you try to kill it.



                  You can always try to use pgrep and kill them at one go, e.g.:



                  kill $(pgrep mysql)


                  But I think the solution would be to find the source where it's get restarted each time, so try checking list of your running/system daemons by using launchctl:



                  sudo launchctl list


                  Then unload as described in: How do you stop MySQL on a Mac OS install?



                  If you've the problem with:




                  [ERROR] Can't open the mysql.plugin table.




                  probably you're running it wrong, by not specifying the right mysql data directories. So maybe it's worth to load them again via launchctl, check how they were run before, or locate your configuration file and double check the configuration, or you've the wrong permissions set-up.



                  Here is sample syntax how you can run it manually:



                  mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/var/db/mysql --datadir=/var/db/mysql --plugin-dir=/var/db/mysql/lib/plugin --user=mysql --tmpdir=/tmp/mysql/tmpdir --log-error=/var/log/mysql_error_log.err --pid-file=/tmp/mysql/mysql.pid --socket=/tmp/mysql/mysql.sock --port=3306


                  When using MAMP, the command-line parameters looks like:



                  /Applications/MAMP/Library/bin/mysqld --defaults-file=/Applications/MAMP/tmp/mysql/my.cnf --basedir=/Applications/MAMP/Library --datadir=/Library/Application Support/appsolute/MAMP PRO/db/mysql --plugin-dir=/Applications/MAMP/Library/lib/plugin --user=mysql --tmpdir=/Applications/MAMP/tmp/mysql/tmpdir --log-error=/Applications/MAMP/logs/mysql_error_log.err --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --socket=/Applications/MAMP/tmp/mysql/mysql.sock --port=3306 





                  share|improve this answer














                  The process probably is probably respawning each time when you try to kill it.



                  You can always try to use pgrep and kill them at one go, e.g.:



                  kill $(pgrep mysql)


                  But I think the solution would be to find the source where it's get restarted each time, so try checking list of your running/system daemons by using launchctl:



                  sudo launchctl list


                  Then unload as described in: How do you stop MySQL on a Mac OS install?



                  If you've the problem with:




                  [ERROR] Can't open the mysql.plugin table.




                  probably you're running it wrong, by not specifying the right mysql data directories. So maybe it's worth to load them again via launchctl, check how they were run before, or locate your configuration file and double check the configuration, or you've the wrong permissions set-up.



                  Here is sample syntax how you can run it manually:



                  mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/var/db/mysql --datadir=/var/db/mysql --plugin-dir=/var/db/mysql/lib/plugin --user=mysql --tmpdir=/tmp/mysql/tmpdir --log-error=/var/log/mysql_error_log.err --pid-file=/tmp/mysql/mysql.pid --socket=/tmp/mysql/mysql.sock --port=3306


                  When using MAMP, the command-line parameters looks like:



                  /Applications/MAMP/Library/bin/mysqld --defaults-file=/Applications/MAMP/tmp/mysql/my.cnf --basedir=/Applications/MAMP/Library --datadir=/Library/Application Support/appsolute/MAMP PRO/db/mysql --plugin-dir=/Applications/MAMP/Library/lib/plugin --user=mysql --tmpdir=/Applications/MAMP/tmp/mysql/tmpdir --log-error=/Applications/MAMP/logs/mysql_error_log.err --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --socket=/Applications/MAMP/tmp/mysql/mysql.sock --port=3306 






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited May 23 '17 at 12:41









                  Community

                  1




                  1










                  answered Oct 8 '15 at 15:43









                  kenorb

                  10.7k1577111




                  10.7k1577111
























                      up vote
                      0
                      down vote













                      That first line you're seeing is the ps aux | grep mysql command that you're (re-)running each time, so not one to worry about.



                      You should be able to kill the mysql process by name if you use sudo pkill mysql.






                      share|improve this answer

























                        up vote
                        0
                        down vote













                        That first line you're seeing is the ps aux | grep mysql command that you're (re-)running each time, so not one to worry about.



                        You should be able to kill the mysql process by name if you use sudo pkill mysql.






                        share|improve this answer























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          That first line you're seeing is the ps aux | grep mysql command that you're (re-)running each time, so not one to worry about.



                          You should be able to kill the mysql process by name if you use sudo pkill mysql.






                          share|improve this answer












                          That first line you're seeing is the ps aux | grep mysql command that you're (re-)running each time, so not one to worry about.



                          You should be able to kill the mysql process by name if you use sudo pkill mysql.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Oct 8 '15 at 15:45









                          s1ns3nt

                          19614




                          19614






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Super User!


                              • 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%2fsuperuser.com%2fquestions%2f983969%2fhow-to-kill-mysql-with-moving-pid%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

                              How do I know what Microsoft account the skydrive app is syncing to?

                              When does type information flow backwards in C++?

                              Grease: Live!