Skip to content

Instantly share code, notes, and snippets.

@forestbaker
Last active November 20, 2015 06:42
Show Gist options
  • Save forestbaker/0597f9cd62e50aa606b1 to your computer and use it in GitHub Desktop.
Save forestbaker/0597f9cd62e50aa606b1 to your computer and use it in GitHub Desktop.
reset mysql password for root user
service mysql stop
mysqld_safe --skip-grant-tables > /dev/null 2>&1 &
# wait for previous command to complete
mysql -u root -e "use mysql; update user set password=PASSWORD('NEW-PASSWORD') where user='root'; flush privileges;"
service mysql start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment