23

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

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".

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

Mac OS version 10.6.

tshepang
  • 12,111
  • 21
  • 91
  • 136
duganets
  • 1,853
  • 5
  • 20
  • 31
  • no. belongs on SO because it's programming related (since mysql is database) – mauris Sep 16 '09 at 09:14
  • Same question asked [here](http://stackoverflow.com/questions/1436425/how-do-you-uninstall-mysql-from-mac-os-x), at roughly the same time it would seem. I posted over there. – mblackwell8 Sep 19 '09 at 04:41

6 Answers6

57

Try running also

sudo rm -rf /var/db/receipts/com.mysql.*
Sophie Alpert
  • 139,698
  • 36
  • 220
  • 238
  • This is the one bit missing from most of the other Googleable answers on MySQL uninstallation. – Craig Walker Dec 21 '10 at 21:09
  • 2
    I actually came across this question while having the same problem with XULRunner, not MySQL, but the answer was the same—removing `/var/db/receipts/org.mozilla.xulrunner.*`. Thank you! – Adam Rosenfield Jun 28 '11 at 19:02
  • I sooo Love Stackoverflow... You saved me bro! Thx a zillion! – Lawrence Aug 02 '13 at 09:56
23

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.*
Otiel
  • 18,404
  • 16
  • 78
  • 126
Arun
  • 231
  • 2
  • 2
  • If you have anything located in the /usr/local/mysql directory this answer provides the most comprehensive solution. – user2122031 Aug 29 '14 at 19:40
3

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.

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):

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

Hope this will be of any help.

  • thx for advices :) i do finding stuff on my disk, like you says, but unfortunately output have a lot of information (libs like PHP of Eclipse etc) – duganets Sep 21 '09 at 11:14
1

I believe you can essentially just delete the /usr/local/mysql-Version/ and unlink the /usr/local/mysql directory. 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.

dlamblin
  • 43,965
  • 20
  • 101
  • 140
1

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

sudo pkgutil --forget com.mysql.mysql
Theozaurus
  • 955
  • 1
  • 8
  • 21
1

On Snow Leopard I had to additionally kill mysqld and did

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*

Team Pannous
  • 1,074
  • 1
  • 8
  • 11