Skip to content

Instantly share code, notes, and snippets.

@heyalexej
Created July 16, 2014 01:34
Show Gist options
  • Save heyalexej/3824b0b2695cf5f1af52 to your computer and use it in GitHub Desktop.
Save heyalexej/3824b0b2695cf5f1af52 to your computer and use it in GitHub Desktop.
reset mysql password
#!/usr/bin/env sh
set -e
# Stop MySQL
sudo /etc/init.d/mysql stop
# Start MySQL skipping checks
sudo mysqld --skip-grant-tables &
# Log in as root
mysql -u root mysql
# Reset password
UPDATE user SET password=PASSWORD('91e4-2ce26006b1b7') WHERE user='root';
FLUSH PRIVILEGES;
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment