Skip to content

Instantly share code, notes, and snippets.

@ekinertac
Last active October 31, 2016 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekinertac/e19bf656e4ccd0d1f5f510eecec84765 to your computer and use it in GitHub Desktop.
Save ekinertac/e19bf656e4ccd0d1f5f510eecec84765 to your computer and use it in GitHub Desktop.
MySQL pid file permisson error solution
############################
# TRY LINE 33 and 34 BEFORE RUN THIS !!!!
############################
mysqldump --all-databases > /tmp/all.mysql.dump.sql
ps -ax | grep mysql
# stop and kill any MySQL processes
brew remove mysql
brew cleanup
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
# edit /etc/hostconfig if you have one 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*
# brew doctor and fix any errors
brew doctor
brew update
brew install mysql
unset TMPDIR
####
sudo rm -rf /usr/local/var/mysql
mysqld --initialize --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql
####
mysql.server start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment