Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  2.  
  3. mkdir -p /usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'`/data/
  4.  
  5. /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 &
  6.  
  7. echo "UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'; FLUSH PRIVILEGES;" > /tmp/resetroot.sql
  8.  
  9. mysql < /tmp/resetroot.sql
  10.  
  11. kill `cat /usr/local/Cellar/mysql/\`brew info mysql | head -n 1 | awk '{print $3}'\`/data/pidfile.pid`
  12.  
  13. rm -f /tmp/resetroot.sql
  14.  
  15. launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement