0

I have uninstalled mysql from XUbuntu 18.04 doing as follows:

sudo apt remove --purge mysql*
sudo apt autoremove
sudo rm /etc/init.d/mysql
sudo systemctl daemon-reload 

I did a backup of /etc/init.d/mysql

mysql was removed from CLI, after this. I confirmed this running:

$ sudo systemctl start mysql
Failed to start mysql.service: Unit mysql.service not found.

Questions:

Why it looks like the service is still working ?

What else do I need to do to fully uninstall mysql ?

This is the output of sudo systemctl status mysql:

$ sudo systemctl status mysql
● mysql.service
  Loaded: not-found (Reason: No such file or directory)
  Active: failed (Result: exit-code) since Fri 2019-04-26 16:02:03 CDT;  24s ago

abr 26 16:02:03 dell4 systemd[1]: Starting LSB: Start and stop the    mysql database server daemon...
abr 26 16:02:03 dell4 systemd[16668]: mysql.service: Failed to execute command: No such file or directory
abr 26 16:02:03 dell4 systemd[16668]: mysql.service: Failed at step  EXEC spawning /etc/init.d/mysql: No such file or directory
abr 26 16:02:03 dell4 systemd[1]: mysql.service: Control process exited, code=exited status=203
abr 26 16:02:03 dell4 systemd[1]: mysql.service: Failed with result 'exit-code'.
abr 26 16:02:03 dell4 systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.

I expected it to be:

Unit mysql.service could not be found.

Thank you in advance !

  • 1
    Thank you very much. It worked when I restarted the system. Thank you. If you put a formal answer I will marked as solved @Kulfy – eliastg Apr 26 at 20:40
1

From the output it is clear that the MySQL was completely removed and systemctl is unable to load and start that service. Whenever a service is modified or removed, systemctl has to be refreshed. To refresh, run:

sudo systemctl daemon-reload

But here for some reason, it wasn't refreshed. In such cases, rebooting helps. Rebooting the system refreshes systemctl thoroughly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.