how to kill process in Mac OS X and not have it restart on its own












24















When I run sudo kill -9 [PID] with the proper process ID, the process stops but then is restarted and has a new PID. I'm trying to kill the mysqld process.



How can I mimic the Activity Monitor in killing a process? In the Activity Monitor, when you press "Quit Process", the process permanently stops running, it is totally terminated. I figure that kill will do the same thing right?



I had both the Activity Monitor and the terminal next to each other to see if the command works, but every time I do sudo kill -9 [PID], the process in Activity monitor doesn't go away, it just refreshes with a new PID.



So... how do I kill the mysqld process via the terminal?










share|improve this question















migrated from stackoverflow.com Jul 2 '10 at 16:48


This question came from our site for professional and enthusiast programmers.



















  • I did it from the activity monitor because the 'kill' command was not recognising the PID. Again unlike your case my mysqld did not restart as soon as I killed it from the Activity monitor.

    – Yoosaf Abdulla
    Sep 28 '13 at 13:46











  • Ouch! Don't use -9 unless you REALLY need to. It's a violent thing to do to a process. Other signals allow a process to terminate in an orderly manner, but not -9! So it means that RAM buffers don't get flushed to disk, for example. This is a particularly bad thing to do to a database that is in the process of doing work; you'll come back to damaged tables.

    – Jan Steinman
    Mar 4 '18 at 2:21
















24















When I run sudo kill -9 [PID] with the proper process ID, the process stops but then is restarted and has a new PID. I'm trying to kill the mysqld process.



How can I mimic the Activity Monitor in killing a process? In the Activity Monitor, when you press "Quit Process", the process permanently stops running, it is totally terminated. I figure that kill will do the same thing right?



I had both the Activity Monitor and the terminal next to each other to see if the command works, but every time I do sudo kill -9 [PID], the process in Activity monitor doesn't go away, it just refreshes with a new PID.



So... how do I kill the mysqld process via the terminal?










share|improve this question















migrated from stackoverflow.com Jul 2 '10 at 16:48


This question came from our site for professional and enthusiast programmers.



















  • I did it from the activity monitor because the 'kill' command was not recognising the PID. Again unlike your case my mysqld did not restart as soon as I killed it from the Activity monitor.

    – Yoosaf Abdulla
    Sep 28 '13 at 13:46











  • Ouch! Don't use -9 unless you REALLY need to. It's a violent thing to do to a process. Other signals allow a process to terminate in an orderly manner, but not -9! So it means that RAM buffers don't get flushed to disk, for example. This is a particularly bad thing to do to a database that is in the process of doing work; you'll come back to damaged tables.

    – Jan Steinman
    Mar 4 '18 at 2:21














24












24








24


17






When I run sudo kill -9 [PID] with the proper process ID, the process stops but then is restarted and has a new PID. I'm trying to kill the mysqld process.



How can I mimic the Activity Monitor in killing a process? In the Activity Monitor, when you press "Quit Process", the process permanently stops running, it is totally terminated. I figure that kill will do the same thing right?



I had both the Activity Monitor and the terminal next to each other to see if the command works, but every time I do sudo kill -9 [PID], the process in Activity monitor doesn't go away, it just refreshes with a new PID.



So... how do I kill the mysqld process via the terminal?










share|improve this question
















When I run sudo kill -9 [PID] with the proper process ID, the process stops but then is restarted and has a new PID. I'm trying to kill the mysqld process.



How can I mimic the Activity Monitor in killing a process? In the Activity Monitor, when you press "Quit Process", the process permanently stops running, it is totally terminated. I figure that kill will do the same thing right?



I had both the Activity Monitor and the terminal next to each other to see if the command works, but every time I do sudo kill -9 [PID], the process in Activity monitor doesn't go away, it just refreshes with a new PID.



So... how do I kill the mysqld process via the terminal?







macos terminal services kill launchd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 6 '11 at 22:28









ChrisF

38.4k1388139




38.4k1388139










asked Jul 2 '10 at 16:35









HristoHristo

4494819




4494819




migrated from stackoverflow.com Jul 2 '10 at 16:48


This question came from our site for professional and enthusiast programmers.









migrated from stackoverflow.com Jul 2 '10 at 16:48


This question came from our site for professional and enthusiast programmers.















  • I did it from the activity monitor because the 'kill' command was not recognising the PID. Again unlike your case my mysqld did not restart as soon as I killed it from the Activity monitor.

    – Yoosaf Abdulla
    Sep 28 '13 at 13:46











  • Ouch! Don't use -9 unless you REALLY need to. It's a violent thing to do to a process. Other signals allow a process to terminate in an orderly manner, but not -9! So it means that RAM buffers don't get flushed to disk, for example. This is a particularly bad thing to do to a database that is in the process of doing work; you'll come back to damaged tables.

    – Jan Steinman
    Mar 4 '18 at 2:21



















  • I did it from the activity monitor because the 'kill' command was not recognising the PID. Again unlike your case my mysqld did not restart as soon as I killed it from the Activity monitor.

    – Yoosaf Abdulla
    Sep 28 '13 at 13:46











  • Ouch! Don't use -9 unless you REALLY need to. It's a violent thing to do to a process. Other signals allow a process to terminate in an orderly manner, but not -9! So it means that RAM buffers don't get flushed to disk, for example. This is a particularly bad thing to do to a database that is in the process of doing work; you'll come back to damaged tables.

    – Jan Steinman
    Mar 4 '18 at 2:21

















I did it from the activity monitor because the 'kill' command was not recognising the PID. Again unlike your case my mysqld did not restart as soon as I killed it from the Activity monitor.

– Yoosaf Abdulla
Sep 28 '13 at 13:46





I did it from the activity monitor because the 'kill' command was not recognising the PID. Again unlike your case my mysqld did not restart as soon as I killed it from the Activity monitor.

– Yoosaf Abdulla
Sep 28 '13 at 13:46













Ouch! Don't use -9 unless you REALLY need to. It's a violent thing to do to a process. Other signals allow a process to terminate in an orderly manner, but not -9! So it means that RAM buffers don't get flushed to disk, for example. This is a particularly bad thing to do to a database that is in the process of doing work; you'll come back to damaged tables.

– Jan Steinman
Mar 4 '18 at 2:21





Ouch! Don't use -9 unless you REALLY need to. It's a violent thing to do to a process. Other signals allow a process to terminate in an orderly manner, but not -9! So it means that RAM buffers don't get flushed to disk, for example. This is a particularly bad thing to do to a database that is in the process of doing work; you'll come back to damaged tables.

– Jan Steinman
Mar 4 '18 at 2:21










8 Answers
8






active

oldest

votes


















20














The process you are killing is probably being managed by launchd, the proper way to stop it and have it not restart is to use launchctl unload <path to plist>. The plist that controls that process is in either /Library/LaunchDaemons or /System/Library/LaunchDaemons. If it is a system process and not one of your own, then you will probably have to use sudo to get launchctl to work as desired.



A better way try and stop it might be;



${MYSQL_HOME}/bin/mysqladmin -u root -proot shutdown > /dev/null 2>&1





share|improve this answer


























  • I'm trying to kill the mysqld process. I'm not sure if that is part of LaunchDaemons... but the following command is the correct way to stop the server from running sudo /usr/local/mysql/support-files/mysql.server stop but I'm having problems with that, so I'm trying to kill the process directly.

    – Hristo
    Jul 2 '10 at 16:44






  • 3





    if it is being restated after kill -9 the launchd is probably involved, even if indirectly. you can tell by using launchctl list

    – Jarrod Roberson
    Jul 2 '10 at 16:56













  • the list doesn't have "mysql" in it. I will try your command up top.

    – Hristo
    Jul 2 '10 at 17:02











  • Redirect STDOUT and STDERR to /dev/null.

    – Hello71
    Jul 2 '10 at 17:56






  • 7





    I had the same problem and was able to solve by removing mysql from launchd via sudo launchctl unload /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

    – Jeff
    Sep 8 '15 at 13:21





















9














A couple of comments mention that "launchd is probably involved" - so I thought I'd put this out as an additional answer. As @jarrod-roberson says, you can check if launchd is involved by first running launchctl list | grep mysqld.



An important thing you learn here is whether MySQL was installed with Homebrew or not - Brew stores its launchctl files in a different location than where OSX puts the "regular" services.



On my OSX box, the plist files are in ~/Library/LaunchAgents/ So I ran:



launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist


to stop the MySQL server. I had previously looked in /Library/LaunchDaemons/ and /Library/LaunchAgents but didn't find a file with mysqld in its name.



You can also install a brew-based system called services, to manage all Brew-installed services applications, as described in this post - http://robots.thoughtbot.com/starting-and-stopping-background-services-with-homebrew I haven't tried this myself, though, so YMMV.






share|improve this answer



















  • 2





    This is what fixed it for me. Always a pain when you are fighting multiple different ways to run a LAMP stack locally.

    – Patrick
    Mar 15 '16 at 14:59











  • I had to use the Homebrew path to remove this, i.e. /usr/local/opt/mysql/homebrew.mxcl.mysql.plist

    – micjamking
    Jan 14 '17 at 23:10



















7














I tried to kill the process by sending it the TERM signal, and that worked. The command was:



sudo kill -15 {PID}





share|improve this answer

































    5














    Unload the service and stop the daemon:



    sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysql.plist


    Load the service and start the daemon:



    sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist





    share|improve this answer


























    • This worked for me except that is was com.oracle.oss.mysql.mysqld.plist My local MySQL was installed from downloading from MySQL, not via homebrew.

      – Jason
      Nov 12 '15 at 18:26





















    3














    For me, this worked once I figured out which label I was looking for.



    launchctl list | egrep {DESIRED_LABEL}   
    launchctl remove {DESIRED_LABEL}





    share|improve this answer

































      2














      What process are you trying to kill? Some processes in Mac OS X (e.g., the Dock, some system processes) automatically respawn if they're killed.






      share|improve this answer
























      • I'm trying to kill the mysqld process

        – Hristo
        Jul 2 '10 at 16:43











      • Probably managed by launchd, then, which will restart it if the process dies.

        – mipadi
        Jul 2 '10 at 17:25



















      1














      I solved editing the /Library/LaunchDaemons/com.mysql.mysql.plist file, changing the attribute true to false



      <!--?xml version="1.0" encoding="UTF-8"?-->
      <plist version="1.0">
      <dict>
      <key>KeepAlive</key>
      <false />
      <key>Label</key>
      <string>com.mysql.mysqld</string>
      <key>ProgramArguments</key>
      <array>
      <string>/usr/local/mysql/bin/mysqld_safe</string>
      <string>--user=mysql</string>
      </array>
      </dict>
      </plist>





      share|improve this answer































        0














        There is a process running on your machine that is blocking mysql. Run



        ps auxwww | grep mysql



        then do



        kill -15 {PID}



        My process that was blocking it was _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%2f159486%2fhow-to-kill-process-in-mac-os-x-and-not-have-it-restart-on-its-own%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









          20














          The process you are killing is probably being managed by launchd, the proper way to stop it and have it not restart is to use launchctl unload <path to plist>. The plist that controls that process is in either /Library/LaunchDaemons or /System/Library/LaunchDaemons. If it is a system process and not one of your own, then you will probably have to use sudo to get launchctl to work as desired.



          A better way try and stop it might be;



          ${MYSQL_HOME}/bin/mysqladmin -u root -proot shutdown > /dev/null 2>&1





          share|improve this answer


























          • I'm trying to kill the mysqld process. I'm not sure if that is part of LaunchDaemons... but the following command is the correct way to stop the server from running sudo /usr/local/mysql/support-files/mysql.server stop but I'm having problems with that, so I'm trying to kill the process directly.

            – Hristo
            Jul 2 '10 at 16:44






          • 3





            if it is being restated after kill -9 the launchd is probably involved, even if indirectly. you can tell by using launchctl list

            – Jarrod Roberson
            Jul 2 '10 at 16:56













          • the list doesn't have "mysql" in it. I will try your command up top.

            – Hristo
            Jul 2 '10 at 17:02











          • Redirect STDOUT and STDERR to /dev/null.

            – Hello71
            Jul 2 '10 at 17:56






          • 7





            I had the same problem and was able to solve by removing mysql from launchd via sudo launchctl unload /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

            – Jeff
            Sep 8 '15 at 13:21


















          20














          The process you are killing is probably being managed by launchd, the proper way to stop it and have it not restart is to use launchctl unload <path to plist>. The plist that controls that process is in either /Library/LaunchDaemons or /System/Library/LaunchDaemons. If it is a system process and not one of your own, then you will probably have to use sudo to get launchctl to work as desired.



          A better way try and stop it might be;



          ${MYSQL_HOME}/bin/mysqladmin -u root -proot shutdown > /dev/null 2>&1





          share|improve this answer


























          • I'm trying to kill the mysqld process. I'm not sure if that is part of LaunchDaemons... but the following command is the correct way to stop the server from running sudo /usr/local/mysql/support-files/mysql.server stop but I'm having problems with that, so I'm trying to kill the process directly.

            – Hristo
            Jul 2 '10 at 16:44






          • 3





            if it is being restated after kill -9 the launchd is probably involved, even if indirectly. you can tell by using launchctl list

            – Jarrod Roberson
            Jul 2 '10 at 16:56













          • the list doesn't have "mysql" in it. I will try your command up top.

            – Hristo
            Jul 2 '10 at 17:02











          • Redirect STDOUT and STDERR to /dev/null.

            – Hello71
            Jul 2 '10 at 17:56






          • 7





            I had the same problem and was able to solve by removing mysql from launchd via sudo launchctl unload /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

            – Jeff
            Sep 8 '15 at 13:21
















          20












          20








          20







          The process you are killing is probably being managed by launchd, the proper way to stop it and have it not restart is to use launchctl unload <path to plist>. The plist that controls that process is in either /Library/LaunchDaemons or /System/Library/LaunchDaemons. If it is a system process and not one of your own, then you will probably have to use sudo to get launchctl to work as desired.



          A better way try and stop it might be;



          ${MYSQL_HOME}/bin/mysqladmin -u root -proot shutdown > /dev/null 2>&1





          share|improve this answer















          The process you are killing is probably being managed by launchd, the proper way to stop it and have it not restart is to use launchctl unload <path to plist>. The plist that controls that process is in either /Library/LaunchDaemons or /System/Library/LaunchDaemons. If it is a system process and not one of your own, then you will probably have to use sudo to get launchctl to work as desired.



          A better way try and stop it might be;



          ${MYSQL_HOME}/bin/mysqladmin -u root -proot shutdown > /dev/null 2>&1






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jul 2 '10 at 17:16

























          answered Jul 2 '10 at 16:37









          Jarrod RobersonJarrod Roberson

          335112




          335112













          • I'm trying to kill the mysqld process. I'm not sure if that is part of LaunchDaemons... but the following command is the correct way to stop the server from running sudo /usr/local/mysql/support-files/mysql.server stop but I'm having problems with that, so I'm trying to kill the process directly.

            – Hristo
            Jul 2 '10 at 16:44






          • 3





            if it is being restated after kill -9 the launchd is probably involved, even if indirectly. you can tell by using launchctl list

            – Jarrod Roberson
            Jul 2 '10 at 16:56













          • the list doesn't have "mysql" in it. I will try your command up top.

            – Hristo
            Jul 2 '10 at 17:02











          • Redirect STDOUT and STDERR to /dev/null.

            – Hello71
            Jul 2 '10 at 17:56






          • 7





            I had the same problem and was able to solve by removing mysql from launchd via sudo launchctl unload /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

            – Jeff
            Sep 8 '15 at 13:21





















          • I'm trying to kill the mysqld process. I'm not sure if that is part of LaunchDaemons... but the following command is the correct way to stop the server from running sudo /usr/local/mysql/support-files/mysql.server stop but I'm having problems with that, so I'm trying to kill the process directly.

            – Hristo
            Jul 2 '10 at 16:44






          • 3





            if it is being restated after kill -9 the launchd is probably involved, even if indirectly. you can tell by using launchctl list

            – Jarrod Roberson
            Jul 2 '10 at 16:56













          • the list doesn't have "mysql" in it. I will try your command up top.

            – Hristo
            Jul 2 '10 at 17:02











          • Redirect STDOUT and STDERR to /dev/null.

            – Hello71
            Jul 2 '10 at 17:56






          • 7





            I had the same problem and was able to solve by removing mysql from launchd via sudo launchctl unload /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

            – Jeff
            Sep 8 '15 at 13:21



















          I'm trying to kill the mysqld process. I'm not sure if that is part of LaunchDaemons... but the following command is the correct way to stop the server from running sudo /usr/local/mysql/support-files/mysql.server stop but I'm having problems with that, so I'm trying to kill the process directly.

          – Hristo
          Jul 2 '10 at 16:44





          I'm trying to kill the mysqld process. I'm not sure if that is part of LaunchDaemons... but the following command is the correct way to stop the server from running sudo /usr/local/mysql/support-files/mysql.server stop but I'm having problems with that, so I'm trying to kill the process directly.

          – Hristo
          Jul 2 '10 at 16:44




          3




          3





          if it is being restated after kill -9 the launchd is probably involved, even if indirectly. you can tell by using launchctl list

          – Jarrod Roberson
          Jul 2 '10 at 16:56







          if it is being restated after kill -9 the launchd is probably involved, even if indirectly. you can tell by using launchctl list

          – Jarrod Roberson
          Jul 2 '10 at 16:56















          the list doesn't have "mysql" in it. I will try your command up top.

          – Hristo
          Jul 2 '10 at 17:02





          the list doesn't have "mysql" in it. I will try your command up top.

          – Hristo
          Jul 2 '10 at 17:02













          Redirect STDOUT and STDERR to /dev/null.

          – Hello71
          Jul 2 '10 at 17:56





          Redirect STDOUT and STDERR to /dev/null.

          – Hello71
          Jul 2 '10 at 17:56




          7




          7





          I had the same problem and was able to solve by removing mysql from launchd via sudo launchctl unload /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

          – Jeff
          Sep 8 '15 at 13:21







          I had the same problem and was able to solve by removing mysql from launchd via sudo launchctl unload /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

          – Jeff
          Sep 8 '15 at 13:21















          9














          A couple of comments mention that "launchd is probably involved" - so I thought I'd put this out as an additional answer. As @jarrod-roberson says, you can check if launchd is involved by first running launchctl list | grep mysqld.



          An important thing you learn here is whether MySQL was installed with Homebrew or not - Brew stores its launchctl files in a different location than where OSX puts the "regular" services.



          On my OSX box, the plist files are in ~/Library/LaunchAgents/ So I ran:



          launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist


          to stop the MySQL server. I had previously looked in /Library/LaunchDaemons/ and /Library/LaunchAgents but didn't find a file with mysqld in its name.



          You can also install a brew-based system called services, to manage all Brew-installed services applications, as described in this post - http://robots.thoughtbot.com/starting-and-stopping-background-services-with-homebrew I haven't tried this myself, though, so YMMV.






          share|improve this answer



















          • 2





            This is what fixed it for me. Always a pain when you are fighting multiple different ways to run a LAMP stack locally.

            – Patrick
            Mar 15 '16 at 14:59











          • I had to use the Homebrew path to remove this, i.e. /usr/local/opt/mysql/homebrew.mxcl.mysql.plist

            – micjamking
            Jan 14 '17 at 23:10
















          9














          A couple of comments mention that "launchd is probably involved" - so I thought I'd put this out as an additional answer. As @jarrod-roberson says, you can check if launchd is involved by first running launchctl list | grep mysqld.



          An important thing you learn here is whether MySQL was installed with Homebrew or not - Brew stores its launchctl files in a different location than where OSX puts the "regular" services.



          On my OSX box, the plist files are in ~/Library/LaunchAgents/ So I ran:



          launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist


          to stop the MySQL server. I had previously looked in /Library/LaunchDaemons/ and /Library/LaunchAgents but didn't find a file with mysqld in its name.



          You can also install a brew-based system called services, to manage all Brew-installed services applications, as described in this post - http://robots.thoughtbot.com/starting-and-stopping-background-services-with-homebrew I haven't tried this myself, though, so YMMV.






          share|improve this answer



















          • 2





            This is what fixed it for me. Always a pain when you are fighting multiple different ways to run a LAMP stack locally.

            – Patrick
            Mar 15 '16 at 14:59











          • I had to use the Homebrew path to remove this, i.e. /usr/local/opt/mysql/homebrew.mxcl.mysql.plist

            – micjamking
            Jan 14 '17 at 23:10














          9












          9








          9







          A couple of comments mention that "launchd is probably involved" - so I thought I'd put this out as an additional answer. As @jarrod-roberson says, you can check if launchd is involved by first running launchctl list | grep mysqld.



          An important thing you learn here is whether MySQL was installed with Homebrew or not - Brew stores its launchctl files in a different location than where OSX puts the "regular" services.



          On my OSX box, the plist files are in ~/Library/LaunchAgents/ So I ran:



          launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist


          to stop the MySQL server. I had previously looked in /Library/LaunchDaemons/ and /Library/LaunchAgents but didn't find a file with mysqld in its name.



          You can also install a brew-based system called services, to manage all Brew-installed services applications, as described in this post - http://robots.thoughtbot.com/starting-and-stopping-background-services-with-homebrew I haven't tried this myself, though, so YMMV.






          share|improve this answer













          A couple of comments mention that "launchd is probably involved" - so I thought I'd put this out as an additional answer. As @jarrod-roberson says, you can check if launchd is involved by first running launchctl list | grep mysqld.



          An important thing you learn here is whether MySQL was installed with Homebrew or not - Brew stores its launchctl files in a different location than where OSX puts the "regular" services.



          On my OSX box, the plist files are in ~/Library/LaunchAgents/ So I ran:



          launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist


          to stop the MySQL server. I had previously looked in /Library/LaunchDaemons/ and /Library/LaunchAgents but didn't find a file with mysqld in its name.



          You can also install a brew-based system called services, to manage all Brew-installed services applications, as described in this post - http://robots.thoughtbot.com/starting-and-stopping-background-services-with-homebrew I haven't tried this myself, though, so YMMV.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 7 '14 at 19:25









          sameerssameers

          20122




          20122








          • 2





            This is what fixed it for me. Always a pain when you are fighting multiple different ways to run a LAMP stack locally.

            – Patrick
            Mar 15 '16 at 14:59











          • I had to use the Homebrew path to remove this, i.e. /usr/local/opt/mysql/homebrew.mxcl.mysql.plist

            – micjamking
            Jan 14 '17 at 23:10














          • 2





            This is what fixed it for me. Always a pain when you are fighting multiple different ways to run a LAMP stack locally.

            – Patrick
            Mar 15 '16 at 14:59











          • I had to use the Homebrew path to remove this, i.e. /usr/local/opt/mysql/homebrew.mxcl.mysql.plist

            – micjamking
            Jan 14 '17 at 23:10








          2




          2





          This is what fixed it for me. Always a pain when you are fighting multiple different ways to run a LAMP stack locally.

          – Patrick
          Mar 15 '16 at 14:59





          This is what fixed it for me. Always a pain when you are fighting multiple different ways to run a LAMP stack locally.

          – Patrick
          Mar 15 '16 at 14:59













          I had to use the Homebrew path to remove this, i.e. /usr/local/opt/mysql/homebrew.mxcl.mysql.plist

          – micjamking
          Jan 14 '17 at 23:10





          I had to use the Homebrew path to remove this, i.e. /usr/local/opt/mysql/homebrew.mxcl.mysql.plist

          – micjamking
          Jan 14 '17 at 23:10











          7














          I tried to kill the process by sending it the TERM signal, and that worked. The command was:



          sudo kill -15 {PID}





          share|improve this answer






























            7














            I tried to kill the process by sending it the TERM signal, and that worked. The command was:



            sudo kill -15 {PID}





            share|improve this answer




























              7












              7








              7







              I tried to kill the process by sending it the TERM signal, and that worked. The command was:



              sudo kill -15 {PID}





              share|improve this answer















              I tried to kill the process by sending it the TERM signal, and that worked. The command was:



              sudo kill -15 {PID}






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Aug 6 '11 at 22:29









              ChrisF

              38.4k1388139




              38.4k1388139










              answered Jul 2 '10 at 17:25









              HristoHristo

              4494819




              4494819























                  5














                  Unload the service and stop the daemon:



                  sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysql.plist


                  Load the service and start the daemon:



                  sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist





                  share|improve this answer


























                  • This worked for me except that is was com.oracle.oss.mysql.mysqld.plist My local MySQL was installed from downloading from MySQL, not via homebrew.

                    – Jason
                    Nov 12 '15 at 18:26


















                  5














                  Unload the service and stop the daemon:



                  sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysql.plist


                  Load the service and start the daemon:



                  sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist





                  share|improve this answer


























                  • This worked for me except that is was com.oracle.oss.mysql.mysqld.plist My local MySQL was installed from downloading from MySQL, not via homebrew.

                    – Jason
                    Nov 12 '15 at 18:26
















                  5












                  5








                  5







                  Unload the service and stop the daemon:



                  sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysql.plist


                  Load the service and start the daemon:



                  sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist





                  share|improve this answer















                  Unload the service and stop the daemon:



                  sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysql.plist


                  Load the service and start the daemon:



                  sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Oct 1 '15 at 13:42









                  8bittree

                  2,46511227




                  2,46511227










                  answered Oct 1 '15 at 12:49









                  OsaevOsaev

                  5111




                  5111













                  • This worked for me except that is was com.oracle.oss.mysql.mysqld.plist My local MySQL was installed from downloading from MySQL, not via homebrew.

                    – Jason
                    Nov 12 '15 at 18:26





















                  • This worked for me except that is was com.oracle.oss.mysql.mysqld.plist My local MySQL was installed from downloading from MySQL, not via homebrew.

                    – Jason
                    Nov 12 '15 at 18:26



















                  This worked for me except that is was com.oracle.oss.mysql.mysqld.plist My local MySQL was installed from downloading from MySQL, not via homebrew.

                  – Jason
                  Nov 12 '15 at 18:26







                  This worked for me except that is was com.oracle.oss.mysql.mysqld.plist My local MySQL was installed from downloading from MySQL, not via homebrew.

                  – Jason
                  Nov 12 '15 at 18:26













                  3














                  For me, this worked once I figured out which label I was looking for.



                  launchctl list | egrep {DESIRED_LABEL}   
                  launchctl remove {DESIRED_LABEL}





                  share|improve this answer






























                    3














                    For me, this worked once I figured out which label I was looking for.



                    launchctl list | egrep {DESIRED_LABEL}   
                    launchctl remove {DESIRED_LABEL}





                    share|improve this answer




























                      3












                      3








                      3







                      For me, this worked once I figured out which label I was looking for.



                      launchctl list | egrep {DESIRED_LABEL}   
                      launchctl remove {DESIRED_LABEL}





                      share|improve this answer















                      For me, this worked once I figured out which label I was looking for.



                      launchctl list | egrep {DESIRED_LABEL}   
                      launchctl remove {DESIRED_LABEL}






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Jun 20 '18 at 18:11









                      Scott C Wilson

                      1,70031529




                      1,70031529










                      answered Sep 20 '15 at 3:26









                      silverdaggersilverdagger

                      1313




                      1313























                          2














                          What process are you trying to kill? Some processes in Mac OS X (e.g., the Dock, some system processes) automatically respawn if they're killed.






                          share|improve this answer
























                          • I'm trying to kill the mysqld process

                            – Hristo
                            Jul 2 '10 at 16:43











                          • Probably managed by launchd, then, which will restart it if the process dies.

                            – mipadi
                            Jul 2 '10 at 17:25
















                          2














                          What process are you trying to kill? Some processes in Mac OS X (e.g., the Dock, some system processes) automatically respawn if they're killed.






                          share|improve this answer
























                          • I'm trying to kill the mysqld process

                            – Hristo
                            Jul 2 '10 at 16:43











                          • Probably managed by launchd, then, which will restart it if the process dies.

                            – mipadi
                            Jul 2 '10 at 17:25














                          2












                          2








                          2







                          What process are you trying to kill? Some processes in Mac OS X (e.g., the Dock, some system processes) automatically respawn if they're killed.






                          share|improve this answer













                          What process are you trying to kill? Some processes in Mac OS X (e.g., the Dock, some system processes) automatically respawn if they're killed.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jul 2 '10 at 16:36









                          mipadimipadi

                          3,7672027




                          3,7672027













                          • I'm trying to kill the mysqld process

                            – Hristo
                            Jul 2 '10 at 16:43











                          • Probably managed by launchd, then, which will restart it if the process dies.

                            – mipadi
                            Jul 2 '10 at 17:25



















                          • I'm trying to kill the mysqld process

                            – Hristo
                            Jul 2 '10 at 16:43











                          • Probably managed by launchd, then, which will restart it if the process dies.

                            – mipadi
                            Jul 2 '10 at 17:25

















                          I'm trying to kill the mysqld process

                          – Hristo
                          Jul 2 '10 at 16:43





                          I'm trying to kill the mysqld process

                          – Hristo
                          Jul 2 '10 at 16:43













                          Probably managed by launchd, then, which will restart it if the process dies.

                          – mipadi
                          Jul 2 '10 at 17:25





                          Probably managed by launchd, then, which will restart it if the process dies.

                          – mipadi
                          Jul 2 '10 at 17:25











                          1














                          I solved editing the /Library/LaunchDaemons/com.mysql.mysql.plist file, changing the attribute true to false



                          <!--?xml version="1.0" encoding="UTF-8"?-->
                          <plist version="1.0">
                          <dict>
                          <key>KeepAlive</key>
                          <false />
                          <key>Label</key>
                          <string>com.mysql.mysqld</string>
                          <key>ProgramArguments</key>
                          <array>
                          <string>/usr/local/mysql/bin/mysqld_safe</string>
                          <string>--user=mysql</string>
                          </array>
                          </dict>
                          </plist>





                          share|improve this answer




























                            1














                            I solved editing the /Library/LaunchDaemons/com.mysql.mysql.plist file, changing the attribute true to false



                            <!--?xml version="1.0" encoding="UTF-8"?-->
                            <plist version="1.0">
                            <dict>
                            <key>KeepAlive</key>
                            <false />
                            <key>Label</key>
                            <string>com.mysql.mysqld</string>
                            <key>ProgramArguments</key>
                            <array>
                            <string>/usr/local/mysql/bin/mysqld_safe</string>
                            <string>--user=mysql</string>
                            </array>
                            </dict>
                            </plist>





                            share|improve this answer


























                              1












                              1








                              1







                              I solved editing the /Library/LaunchDaemons/com.mysql.mysql.plist file, changing the attribute true to false



                              <!--?xml version="1.0" encoding="UTF-8"?-->
                              <plist version="1.0">
                              <dict>
                              <key>KeepAlive</key>
                              <false />
                              <key>Label</key>
                              <string>com.mysql.mysqld</string>
                              <key>ProgramArguments</key>
                              <array>
                              <string>/usr/local/mysql/bin/mysqld_safe</string>
                              <string>--user=mysql</string>
                              </array>
                              </dict>
                              </plist>





                              share|improve this answer













                              I solved editing the /Library/LaunchDaemons/com.mysql.mysql.plist file, changing the attribute true to false



                              <!--?xml version="1.0" encoding="UTF-8"?-->
                              <plist version="1.0">
                              <dict>
                              <key>KeepAlive</key>
                              <false />
                              <key>Label</key>
                              <string>com.mysql.mysqld</string>
                              <key>ProgramArguments</key>
                              <array>
                              <string>/usr/local/mysql/bin/mysqld_safe</string>
                              <string>--user=mysql</string>
                              </array>
                              </dict>
                              </plist>






                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Oct 19 '17 at 12:16









                              MarioMario

                              111




                              111























                                  0














                                  There is a process running on your machine that is blocking mysql. Run



                                  ps auxwww | grep mysql



                                  then do



                                  kill -15 {PID}



                                  My process that was blocking it was _mysql






                                  share|improve this answer




























                                    0














                                    There is a process running on your machine that is blocking mysql. Run



                                    ps auxwww | grep mysql



                                    then do



                                    kill -15 {PID}



                                    My process that was blocking it was _mysql






                                    share|improve this answer


























                                      0












                                      0








                                      0







                                      There is a process running on your machine that is blocking mysql. Run



                                      ps auxwww | grep mysql



                                      then do



                                      kill -15 {PID}



                                      My process that was blocking it was _mysql






                                      share|improve this answer













                                      There is a process running on your machine that is blocking mysql. Run



                                      ps auxwww | grep mysql



                                      then do



                                      kill -15 {PID}



                                      My process that was blocking it was _mysql







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Mar 2 '17 at 13:33









                                      Jonathan OJonathan O

                                      11




                                      11






























                                          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.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function () {
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f159486%2fhow-to-kill-process-in-mac-os-x-and-not-have-it-restart-on-its-own%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á

                                           ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕