Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
396
rated 0 times [  396] [ 0]  / answers: 1 / hits: 977339  / 2 Years ago, thu, september 1, 2022, 2:25:03

I installed MySQL using sudo apt-get. Now I need to remove it from my system.



How can I do that?


More From » mysql

 Answers
6

I assume that you don't need MySQL anymore and you have already taken backup of your important databases. I suggest you to take backup of your important MySQL databases.


Note: Your all mysql data will be lost.


First make sure that MySQL service is stopped.


sudo systemctl stop mysql

Remove MySQL related all packages completely.


sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*

Remove MySQL configuration and data. If you have changed database location in your MySQL configuration, you need to replace /var/lib/mysql according to it.


sudo rm -rf /etc/mysql /var/lib/mysql

(Optional) Remove unnecessary packages.


sudo apt autoremove

(Optional) Remove apt cache.


sudo apt autoclean

[#36354] Friday, September 2, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
teromato

Total Points: 139
Total Questions: 102
Total Answers: 100

Location: Liechtenstein
Member since Mon, May 15, 2023
1 Year ago
;