Skip to content

Instantly share code, notes, and snippets.

@petrleocompel
Created July 11, 2016 13:08
Show Gist options
  • Save petrleocompel/542957c46437181abf8e70fb7cb92913 to your computer and use it in GitHub Desktop.
Save petrleocompel/542957c46437181abf8e70fb7cb92913 to your computer and use it in GitHub Desktop.
Mysql - reinstall (with db remove) + no root pass
apt-get remove mysql-server mysql-client mysql-server-core* mysql-client-*
rm -rf /var/lib/mysql /etc/mysql
update-alternatives --remove my.cnf /etc/mysql/my.cnf.fallback
update-alternatives --remove my.cnf /etc/mysql/my.cnf
update-alternatives --remove my.cnf /etc/mysql/mysql.cnf
apt-get install mysql-server mysql-client mysql-server-core* mysql-client-*
dpkg --force-confmiss --install /var/cache/apt/archives/mysql-*
UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root';
SET PASSWORD FOR 'root'@'localhost' = '';
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment