-
Notifications
You must be signed in to change notification settings - Fork 25
/
brew-uninstall-mysql
47 lines (39 loc) · 1.23 KB
/
brew-uninstall-mysql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
##
# Brew uninstall MySQL database
#
# See guide https://gist.github.com/brandonsimpson/5204ce8a46f7a20071b5
#
# Before you run this script, you may want to backup
# all your local MySQL databases:
#
# $ mysqldump -uroot -p \
# --all-databases \
# --flush-logs \
# --master-data=2 \
# > all_databases.sql
#
##
# Stop servers
sudo mysql.server stop
sudo /usr/local/mysql/support-files/mysql.server stop
# Remove files
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm /Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/PreferencePanes/MySQL*
sudo rm -rf ~/Library/PreferencePanes/MySQL*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf ~/Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf ~/Library/Receipts/MySQL*
sudo rm -rf /Library/StartupItems/MySQL*
sudo rm -rf ~/Library/StartupItems/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*
sudo rm -rf /private/var/db/receipts/*MySQL*
echo "edit /etc/hostconfig and remove the line MYSQLCOM=-YES-"
brew uninstall mysql
brew cleanup
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
mv /etc/my.cnf /etc/my.cnf.backup