Score:0

I can't remove mysql as I cannot stop it

co flag

I want to remove mysql-server but I cannot do so until I stop the service. However, when first downloading it, it didn't start to begin with. So now if I try and start or stop it I get the error message "Unit mysql.service not found." and "Unit mysql.service not loaded." respectively.

So I tried manually deleting it by removing /etc/mysql and /var/lib/mysql but by doing that I can no longer reload it to maybe salvage the situation.

To be clear, I need to stop it before I can remove it, but to stop it, it has to be started to begin with, and to start it it must be loaded, and since I deleted it's conf files it cannot be reloaded... What can I do?

Score:0
co flag

Okay I managed to solve it in a round about way. Running the following command:

systemctl list-unit-files --type service -all | grep mysql

will print all the services currently on your computer. service.mysql had a status of "bad" for me which caused the problem, so I ran the command:

sudo systemctl disable mysql.service

to disable it. Having done that I then stopped it by:

sudo systemctl stop mysql.service

and finally I deleted everything relating to sql by:

sudo apt remove --purge mysql-*

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.