Last active
August 10, 2021 15:08
-
-
Save nicolasramy/95941b09260bf7f2b2cdbb705c3ba85b to your computer and use it in GitHub Desktop.
Revisions
-
nicolasramy revised this gist
Aug 10, 2021 . 1 changed file with 29 additions and 19 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,32 +2,42 @@ To remove everything related to MySQL, you have to follow this procedure ```shell sudo -i service mysql stop killall -KILL mysql mysqld_safe mysqld apt-get --yes purge mysql-server mysql-client apt-get --yes autoremove --purge apt-get autoclean deluser --remove-home mysql delgroup mysql rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld updatedb exit ``` ## Change root password Stop MySQL Server ```shell service mysql stop ``` Start Mysql uin safe mode without Grant Privileges ```shell mysqld_safe --skip-grant-tables ``` ### For MySQL 5.7.6+ ```sql ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass'; ``` ### For MySQL 5.7.5 and lesser ```sql SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass'); ``` -
nicolasramy created this gist
Jul 25, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ ## Remove To remove everything related to MySQL, you have to follow this procedure sudo -i service mysql stop killall -KILL mysql mysqld_safe mysqld apt-get --yes purge mysql-server mysql-client apt-get --yes autoremove --purge apt-get autoclean deluser --remove-home mysql delgroup mysql rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld updatedb exit ## Change root password Stop MySQL Server service mysql stop Start Mysql uin safe mode without Grant Privileges mysqld_safe --skip-grant-tables ### For MySQL 5.7.6+ ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass'; ### For MySQL 5.7.5 and lesser SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');