mleglise/dotfiles-public — Issue #4: mysql install for Lion
Author: jspooner
Created: 2012-02-22 19:49:06+00:00
State: open

```
57 brew install mysql
58 unset TMPDIR
59 mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
60 cp /usr/local/Cellar/mysql/5.5.14/com.mysql.mysqld.plist ~/Library/LaunchAgents/
61 mkdir -p ~/Library/LaunchAgents
62 cp /usr/local/Cellar/mysql/5.5.19/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
63 launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
64 vim /usr/local/etc/my.cnf
65 mysql.server start
66 history
```

/usr/local/etc/my.cnf
```
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
bind-address = 127.0.0.1
port = 3306
socket = /tmp/mysql.sock
```

Then don't forget to change your password.

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/local/Cellar/mysql/5.5.19/bin/mysqladmin -u root password 'new-password'
/usr/local/Cellar/mysql/5.5.19/bin/mysqladmin -u root -h wl00031128.active.local password 'new-password'