1

I was trying to uninstall mysql from Mac. I was following the instruction given in How do you uninstall MySQL from Mac OS X?

In more detail, I execute the following command line-by-line:

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*

Everything worked fine, apart from trying to edit /etc/hostconfig by removing the line MYSQLCOM=-NO. It said the file is read-only. I have tried to change the permission of the file through Get Info, but I still cannot edit that file. Has any one encounter this as well and how to solve this?

If I keep the file hostconfig as it is, would this do any harm if I try to install mysql again?

Community
  • 1
  • 1
bozhao
  • 51
  • 1
  • 4

1 Answers1

0

I test and works this command in terminal:

Use mysqldump to backup your databases to text files!

Stop the database server

$ 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*
Cubiczx
  • 1,005
  • 11
  • 10