开发者

Can't stop Mysql 5.1 on Mac OSX 10.6

I'm trying to stop Mysql v5.1 on MacOSX 10.6 so that I can upgrade to Mysql v5.5.

I believe I installed v5.1 from source many months ago. I've attempted all the methods listed here: How do you stop MySQL on a Mac OS install?.

However when I do a "mysqladmin shutdown" it seems the os just spawns another mysql process:

$ sudo mysqladmin shutdown
$ ps -Af | grep mysql
   74 53283     1   0   0:00.01 ??         0:00.01 /bin/sh /usr/local/mysql/bin/mysqld_safe
  开发者_运维问答 74 53324 53283   0   0:00.01 ??         0:00.03 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --log-error=/usr/local/mysql/var/Al.local.err --pid-file=/usr/local/mysql/var/Al.local.pid
  501 53343 52577   0   0:00.00 ttys003    0:00.00 grep mysql

The same thing happens if I try to kill the process. (However if I try to kill the mysqld_safe process I get "No such process")

I've looked in /Library/StartupItems and there's no MySQL directory. I know I didn't use MacPorts to install Mysql.

What am I missing here? How do I slay this beast?


@Sly -- your fix works nicely. However, if you didn't want to restart I found (in man launchctl) that you can also make it stop restarting mysql by issuing the following command:

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

PS: Your com.mysql.mysqld.plist file may be in /Library/LaunchDaemons or /Library/LaunchAgents or in ~/Library/LaunchDaemons or ~/Library/LaunchAgents


I have a similar install without the launcher daemon. I run mysqld in a terminal. I find the only way I can shut it down is by sending signal 11 to the mysqld process.


MySQL is started using launchctl take help of launchctrl to unload it

  launchctl interfaces with launchd to load, unload daemons/agents and generally control launchd

Try unload the should resolve the Issue

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

if mysql has not loaded using the launchctl utilty then unload will not stop the mysql then in this case the regular sudo mysqladmin shutdown will work

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜