I have MySQL installed on my localhost. What happens if I have a problem with mysql and I want to re-install it again? Do I lose my existing databases?
To purge and install mysql-server:
If you want to delete the database too, you must delete it first before you remove mysql. To delete the database cleanly, on the mysql prompt type:
I found another way to delete the database files, but I am not sure whether this is a clean way to delete the database, so take it with a pinch of salt:
So check the location of your databases in these two locations and delete the directory of the databases(requires superuser privileges to read and delete).