如何从Mac OS X卸载MySQL ?

时间:2021-12-06 07:16:42

I accidentally installed the PowerPC version of MySQL on my Intel Mac in Snow Leopard, and it installed without a problem but of course doesn't run properly. I just didn't pay enough attention. Now when I try to install the correct x86 version it says that it can't install because a newer version is already installed. A Google query led me to perform these actions/delete these files to uninstall it:

我不小心在我的英特尔Mac电脑上安装了PowerPC版本的MySQL,在雪豹上安装没有问题,但当然不能正常运行。我只是没有给予足够的关注。现在,当我尝试安装正确的x86版本时,它说它不能安装,因为已经安装了更新的版本。谷歌查询导致我执行这些操作/删除这些文件来卸载它:

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/MySQL*
rm -rf ~/Library/PreferencePanes/MySQL*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*

And finally removed the line MYSQLCOM=-YES- from /etc/hostconfig

最后删除了/etc/hostconfig中的MYSQLCOM=- yes行

They haven't seemed to help at all. I am still receiving the same message about there being a newer version. I tried installing an even newer version (the current Beta) and it also gave me the same message about a newer version already being installed. I can't uninstall it from the Prefs Pane because I never installed the PrefPane also.

他们似乎一点帮助都没有。我仍然收到关于有一个新版本的相同消息。我试着安装一个更新的版本(当前的测试版),它也给了我同样的信息,告诉我已经安装了一个更新的版本。我无法从Prefs窗格中卸载它,因为我也从未安装过PrefPane。

11 个解决方案

#1


209  

Try running also

尝试运行也

sudo rm -rf /var/db/receipts/com.mysql.*

#2


33  

I also had entries in:

我还在:

/Library/Receipts/InstallHistory.plist

that i had to delete.

我必须删除它。

#3


15  

If you installed mysql through brew then we can use command to uninstall mysql.

如果您通过brew安装了mysql,那么我们可以使用命令卸载mysql。

$ brew uninstall mysql

Uninstalling /usr/local/Cellar/mysql/5.6.19...

This worked for me.

这为我工作。

#4


6  

Aside from the long list of remove commands in your question, which seems quite comprehensive in my recent experience of exactly this issue, I found mysql.sock running in /private/var and removed that. I used

除了在你的问题中列出了一长串的删除命令,这在我最近处理这个问题的经验中看起来相当全面,我还找到了mysql。运行在/private/var中的袜子并删除它。我使用

find / -name mysql -print 2> /dev/null

查找/ -name mysql -打印2> /dev/null

...to find anything that looked like a mysql directory or file and removed most of what came up (aside from Perl/Python access modules). You may also need to check that the daemon is not still running using Activity Monitor (or at the command line using ps -A). I found that mysqld was still running even after deleting the files.

…查找任何看起来像mysql目录或文件的内容,并删除其中的大部分内容(除了Perl/Python访问模块)。您可能还需要检查守护进程是否仍在使用Activity Monitor(或者在命令行中使用ps -A)运行。我发现即使删除了文件,sqmyld仍然在运行。

#5


6  

ps -ax | grep mysql

*stop and kill any MySQL processes

停止并终止任何MySQL进程

brew remove mysql
brew cleanup

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/MySql*

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

edit /etc/hostconfig and remove the line MYSQLCOM=-YES-

编辑/etc/hostconfig并删除行MYSQLCOM=- yes -

rm -rf ~/Library/PreferencePanes/My*    
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*

*restart your computer just to ensure any MySQL processes are killed try to run mysql, it shouldn't work

重新启动你的电脑,以确保任何MySQL进程被终止尝试运行MySQL,它不应该工作

#6


4  

I also had a config file at /etc/my.cnf that I needed to delete on my Mac OS X Snow Leopard install

我还在/etc/my.cnf上有一个配置文件,需要在Mac OS X雪豹上删除它

#7


3  

You need to identify where MySQL was installed to before attempting to delete it.

在尝试删除MySQL之前,您需要确定它安装的位置。

I always use the Hivelogic guide to installing under Mac OS X which builds MySQL from source. When setting up the build you can specify a directory under which to install MySQL with the --prefix parameter. You should make sure the directory does not exist and attempt to install from source.

我一直使用Hivelogic指南来安装Mac OS X,它从源代码构建MySQL。在设置构建时,您可以指定一个目录,其中使用-prefix参数安装MySQL。您应该确保该目录不存在,并尝试从源代码安装。

./configure --prefix=/usr/local/mysql --with-extra-charsets=complex \
--enable-thread-safe-client --enable-local-infile --enable-shared \
--with-plugins=innobase

#8


3  

It might be overkill but your MySQL command history can also be wiped from:

这可能有点过了,但是你的MySQL命令历史也可以从:

~/.mysql_history

#9


3  

You should also check /var/db/receipts and remove all entries that contain com.mysql.*

您还应该检查/var/db/receipt并删除包含com.mysql.*的所有条目

Using sudo rm -rf /var/db/receipts/com.mysql.* didn't work for me. I had to go into var/db/receipts and delete each one seperately.

使用sudo rm -rf /var/db/ receipts/com.myl*对我没用。我必须进入var/db/receipt并分别删除。

#10


0  

For me, I had installed MariaDB years ago using homebrew. Correct uninstall procedure was: brew uninstall mariadb.

对我来说,几年前我就用homebrew安装了MariaDB。正确的卸载程序是:brew uninstall mariadb。

#11


-5  

sudo find / | grep -i mysql

找到/ | grep -i mysql

This worked like a charm for me. Just went through the list and ensured that anything MySQL related was deleted.

这对我来说很有吸引力。只要浏览一下列表,确保所有与MySQL相关的内容都被删除。

#1


209  

Try running also

尝试运行也

sudo rm -rf /var/db/receipts/com.mysql.*

#2


33  

I also had entries in:

我还在:

/Library/Receipts/InstallHistory.plist

that i had to delete.

我必须删除它。

#3


15  

If you installed mysql through brew then we can use command to uninstall mysql.

如果您通过brew安装了mysql,那么我们可以使用命令卸载mysql。

$ brew uninstall mysql

Uninstalling /usr/local/Cellar/mysql/5.6.19...

This worked for me.

这为我工作。

#4


6  

Aside from the long list of remove commands in your question, which seems quite comprehensive in my recent experience of exactly this issue, I found mysql.sock running in /private/var and removed that. I used

除了在你的问题中列出了一长串的删除命令,这在我最近处理这个问题的经验中看起来相当全面,我还找到了mysql。运行在/private/var中的袜子并删除它。我使用

find / -name mysql -print 2> /dev/null

查找/ -name mysql -打印2> /dev/null

...to find anything that looked like a mysql directory or file and removed most of what came up (aside from Perl/Python access modules). You may also need to check that the daemon is not still running using Activity Monitor (or at the command line using ps -A). I found that mysqld was still running even after deleting the files.

…查找任何看起来像mysql目录或文件的内容,并删除其中的大部分内容(除了Perl/Python访问模块)。您可能还需要检查守护进程是否仍在使用Activity Monitor(或者在命令行中使用ps -A)运行。我发现即使删除了文件,sqmyld仍然在运行。

#5


6  

ps -ax | grep mysql

*stop and kill any MySQL processes

停止并终止任何MySQL进程

brew remove mysql
brew cleanup

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/MySql*

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

edit /etc/hostconfig and remove the line MYSQLCOM=-YES-

编辑/etc/hostconfig并删除行MYSQLCOM=- yes -

rm -rf ~/Library/PreferencePanes/My*    
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*

*restart your computer just to ensure any MySQL processes are killed try to run mysql, it shouldn't work

重新启动你的电脑,以确保任何MySQL进程被终止尝试运行MySQL,它不应该工作

#6


4  

I also had a config file at /etc/my.cnf that I needed to delete on my Mac OS X Snow Leopard install

我还在/etc/my.cnf上有一个配置文件,需要在Mac OS X雪豹上删除它

#7


3  

You need to identify where MySQL was installed to before attempting to delete it.

在尝试删除MySQL之前,您需要确定它安装的位置。

I always use the Hivelogic guide to installing under Mac OS X which builds MySQL from source. When setting up the build you can specify a directory under which to install MySQL with the --prefix parameter. You should make sure the directory does not exist and attempt to install from source.

我一直使用Hivelogic指南来安装Mac OS X,它从源代码构建MySQL。在设置构建时,您可以指定一个目录,其中使用-prefix参数安装MySQL。您应该确保该目录不存在,并尝试从源代码安装。

./configure --prefix=/usr/local/mysql --with-extra-charsets=complex \
--enable-thread-safe-client --enable-local-infile --enable-shared \
--with-plugins=innobase

#8


3  

It might be overkill but your MySQL command history can also be wiped from:

这可能有点过了,但是你的MySQL命令历史也可以从:

~/.mysql_history

#9


3  

You should also check /var/db/receipts and remove all entries that contain com.mysql.*

您还应该检查/var/db/receipt并删除包含com.mysql.*的所有条目

Using sudo rm -rf /var/db/receipts/com.mysql.* didn't work for me. I had to go into var/db/receipts and delete each one seperately.

使用sudo rm -rf /var/db/ receipts/com.myl*对我没用。我必须进入var/db/receipt并分别删除。

#10


0  

For me, I had installed MariaDB years ago using homebrew. Correct uninstall procedure was: brew uninstall mariadb.

对我来说,几年前我就用homebrew安装了MariaDB。正确的卸载程序是:brew uninstall mariadb。

#11


-5  

sudo find / | grep -i mysql

找到/ | grep -i mysql

This worked like a charm for me. Just went through the list and ensured that anything MySQL related was deleted.

这对我来说很有吸引力。只要浏览一下列表,确保所有与MySQL相关的内容都被删除。