Skip to content

Instantly share code, notes, and snippets.

@chrisdchristo
Last active December 29, 2015 17:39
Show Gist options
  • Save chrisdchristo/7706101 to your computer and use it in GitHub Desktop.
Save chrisdchristo/7706101 to your computer and use it in GitHub Desktop.
101: Resetting MySQL

101: MySQL Reinstall

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql*
sudo apt-get install mysql-server
sudo /usr/bin/mysql_secure_installation

Change newpassword to your desired password.

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'newpassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment