Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
- mkdir -p /usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'`/data/
- /usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'`/bin/mysqld --basedir=/usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'` --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'`/lib/plugin --log-error=/usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'`/data/errors.err --pid-file=/usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'`/data/pidfile.pid --skip-grant-tables 2>&1 &
- echo "UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'; FLUSH PRIVILEGES;" > /tmp/resetroot.sql
- mysql < /tmp/resetroot.sql
- kill `cat /usr/local/Cellar/mysql/\`brew info mysql | head -n 1 | awk '{print $3}'\`/data/pidfile.pid`
- rm -f /tmp/resetroot.sql
- launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement