gullinbursti

Remove MySQL (brew)

Apr 6th, 2019
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. # Uninstall all those broken versions of MySQL and re-install it with Brew on Mac Mavericks
  2. # Remove MySQL completely:
  3.  
  4.  
  5. 01. ps -ax | grep mysql
  6. 02. kill -9 `ps -ax | grep mysql | awk '{print $1}'`
  7. 03. brew remove mysql
  8. 04. brew cleanup
  9. 05. sudo rm /usr/local/mysql
  10. 06. sudo rm -rf /usr/local/var/mysql
  11. 07. sudo rm -rf /usr/local/mysql*
  12. 08. sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  13. 09. sudo rm -rf /Library/StartupItems/MySQLCOM
  14. 10. sudo rm -rf /Library/PreferencePanes/My*
  15. 11. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  16. 12. nano /etc/hostconfig --remove the line "MYSQLCOM=-YES-"
  17. 13. rm -rf ~/Library/PreferencePanes/My*
  18. 14. sudo rm -rf /Library/Receipts/mysql*
  19. 15. sudo rm -rf /Library/Receipts/MySQL*
  20. 16. sudo rm -rf /private/var/db/receipts/*mysql*
  21.  
  22. #-- Apparently the receipts are in a different location for the newer versions of MySQL
  23. #-- so line #16 was added to clean them out as well. Remember, these steps will completely
  24. #-- Remove MySQL and any data residing in the default locations.
  25.  
  26.  
  27. # Restart your computer just to ensure any MySQL processes are killed ###Try to run mysql, it shouldn't work
  28. # Brew install MySQL per user:
  29.  
  30. 01. brew doctor and fix any errors
  31. 02. brew update
  32. 03. brew install mysql
  33. 04. unset TMPDIR
  34. 05. mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
  35. 06. mysql.server start
  36.  
  37. #-- Run the commands Brew suggests, add MySQL to launchctl so it automatically launches at startup.
  38. #-- mysql should now work and be running all the time as expected
Advertisement
Add Comment
Please, Sign In to add comment