Skip to content

Instantly share code, notes, and snippets.

@thesuhu
Created February 3, 2022 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thesuhu/2859b245fd05a0ac45e5af6a4a144671 to your computer and use it in GitHub Desktop.
Save thesuhu/2859b245fd05a0ac45e5af6a4a144671 to your computer and use it in GitHub Desktop.
Uninstall or Remove MySQL from Ubuntu
# Make sure MySQL is not running
sudo systemctl stop mysql
# Then purge all of the MySQL packages
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
# Then delete all of the MySQL files
sudo rm -rf /etc/mysql /var/lib/mysql /var/log/mysql
# Finally clean all packages that are not needed:
# List item
sudo apt autoremove
sudo apt autoclean
# Remove history if needed
rm ~/.mysql_history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment