Skip to content

Instantly share code, notes, and snippets.

@Dante383
Created March 18, 2018 21:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dante383/6a150e3f35735562235c65430309efd2 to your computer and use it in GitHub Desktop.
Save Dante383/6a150e3f35735562235c65430309efd2 to your computer and use it in GitHub Desktop.
Remove MySQL completly
#!/bin/sh
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment