Skip to content

Instantly share code, notes, and snippets.

@midhunkrishna
Created February 17, 2014 05:25
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 midhunkrishna/9045188 to your computer and use it in GitHub Desktop.
Save midhunkrishna/9045188 to your computer and use it in GitHub Desktop.
A gist to configure mysql on mac machine for Rails
brew install mysql #install mysql using home brew
mysql_install_db --verbose --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mysql/<mysql dist version you have>/<the plist file you have in this dir>.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/<the plist file you have in this dir>.plist
#try
mysql -uroot; #if it works: yayyyy !!!
#Resetting mysql root password
$ mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("NEWPASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment