macos 如何在 Mac OS X 上删除 MySQL 的安装

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1431823/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:24:25  来源:igfitidea点击:

How to remove installation of MySQL on Mac OS X

mysqlmacosinstall

提问by duganets

I need to install older version of mysql server on mac os, but I have a newer version.

我需要在 mac os 上安装旧版本的 mysql 服务器,但我有一个新版本。

I tried to remove this newer installation (5.1), but when start old version install (5.0b) message "MySQL 5.0.51b-community for Mac OS X can't be installed in this disk. A newer version of this software alrady exists on this disk".

我试图删除这个较新的安装 (5.1),但是当开始旧版本安装 (5.0b) 消息“MySQL 5.0.51b-community for Mac OS X 无法安装在此磁盘中。此软件的较新版本已经存在在这个磁盘上”。

I can't recognize problem, because I remove all data of previouse install, but installer says no.

我无法识别问题,因为我删除了以前安装的所有数据,但安装程序说没有。

Mac OS version 10.6.

Mac 操作系统版本 10.6。

回答by Sophie Alpert

Try running also

也尝试跑步

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

回答by Arun

Try this, I had to struggle but this works for me!!!!!!!

试试这个,我不得不挣扎,但这对我有用!!!!!!!!!

  1. sudo rm /usr/local/mysql
  2. sudo rm -rf /usr/local/mysql*
  3. sudo rm -rf /Library/StartupItems/MySQLCOM
  4. sudo rm -rf /Library/PreferencePanes/My*
  5. (Edit /etc/hostconfig) sudo vi /etc/hostconfig(Remove line MYSQLCOM=-YES)
  6. sudo rm -rf /Library/Receipts/mysql*
  7. sudo rm -rf /Library/Receipts/MySQL*
  8. sudo rm -rf /var/db/receipts/com.mysql.*
  1. sudo rm /usr/local/mysql
  2. sudo rm -rf /usr/local/mysql*
  3. sudo rm -rf /Library/StartupItems/MySQLCOM
  4. sudo rm -rf /Library/PreferencePanes/My*
  5. (编辑 /etc/hostconfig)sudo vi /etc/hostconfig(删除行 MYSQLCOM=-YES)
  6. sudo rm -rf /Library/Receipts/mysql*
  7. sudo rm -rf /Library/Receipts/MySQL*
  8. sudo rm -rf /var/db/receipts/com.mysql.*

回答by Kristinn ?rn Siguresson

Test finding all files and folders with "mysql" in their name, take a look at them and see if they must be deleted as well.

测试查找名称中带有“mysql”的所有文件和文件夹,看看它们是否也必须删除。

Use the following command to find all the files.

使用以下命令查找所有文件。

sudo find / | grep -i mysql

You can scroll through the output if you put | less at the end (it won't show anything up until it finds something, just so you wouldn't think the command failed.) :-) You can write it as follows.

如果您输入 |,您可以滚动浏览输出 最后更少(在找到某些内容之前它不会显示任何内容,这样您就不会认为该命令失败了。):-) 您可以按如下方式编写它。

sudo find / | grep -i mysql | less

To remove the files/folders, you will have to run the following command (-f means force so you won't be able to restore the files and you won't be asked for a confirmation before they are deleted):

要删除文件/文件夹,您必须运行以下命令(-f 表示强制,因此您将无法恢复文件,并且在删除文件之前不会要求您确认):

sudo rm -rf /path/to/file/or/folder

Hope this will be of any help.

希望这会有所帮助。

回答by dlamblin

I believe you can essentially just delete the /usr/local/mysql-Version/and unlink the /usr/local/mysqldirectory. Getting rid of the system pref and the start up item might be harder, but I didn't install those so I can't help there.

我相信您基本上可以删除/usr/local/mysql-Version/并取消链接/usr/local/mysql目录。摆脱系统首选项和启动项可能更难,但我没有安装它们,所以我无能为力。

回答by Theozaurus

You can use the built-in utility pkgutil to remove the package receipt:

您可以使用内置实用程序 pkgutil 删除包裹收据:

sudo pkgutil --forget com.mysql.mysql

回答by Team Pannous

On Snow Leopard I had to additionally kill mysqld and did

在雪豹上,我不得不另外杀死 mysqld 并做了

rm /private/var/db/receipts/com.mysql.*

rm /private/var/db/receipts/com.mysql.*

sudo rm -rf /Users//Library/StartupItems/MySQLCOM sudo rm -rf /Users//Library/PreferencePanes/My* sudo rm -rf /Users//Library/Receipts/mysql* sudo rm -rf /Users//Library/Receipts/MySQL*

sudo rm -rf /Users//Library/StartupItems/MySQLCOM sudo rm -rf /Users//Library/PreferencePanes/My* sudo rm -rf /Users//Library/Receipts/mysql* sudo rm -rf /Users//Library /收据/MySQL*