从Mac OS x卸载MySQL

时间:2014-05-23 22:05:27

标签: mysql macos

我试图从Mac上卸载mysql。我按照How do you uninstall MySQL from Mac OS X?

中的说明进行操作

更详细地说,我逐行执行以下命令:

sudo rm /usr/local/mysql

sudo rm -rf /usr/local/mysql*

sudo rm -rf /Library/StartupItems/MySQLCOM

sudo rm -rf /Library/PreferencePanes/MySQL*

vim /etc/hostconfig and removed the line MYSQLCOM=-YES- //(in my case, the line is MYSQLCOM=-NO)

rm -rf ~/Library/PreferencePanes/MySQL*

sudo rm -rf /Library/Receipts/mysql*

sudo rm -rf /Library/Receipts/MySQL*

除了尝试通过删除行MYSQLCOM=-NO来编辑/ etc / hostconfig之外,一切正常。它说该文件是只读的。我试图通过Get Info更改文件的权限,但我仍然无法编辑该文件。有没有人遇到这个以及如何解决这个问题?

如果我按原样保留文件hostconfig,如果我再次尝试安装mysql会不会造成任何伤害?

1 个答案:

答案 0 :(得分:0)

我在终端测试并运行此命令:

使用mysqldump将数据库备份为文本文件!

停止数据库服务器

$ sudo rm /usr/local/mysql
$ sudo rm -rf /usr/local/mysql*
$ sudo rm -rf /Library/StartupItems/MySQLCOM
$ sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line 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*
$ sudo rm -rf /var/db/receipts/com.mysql.mysql*