There are many programming languages today, designed for data management such as SQLite and PostgreSQL. Of these languages, one of the most popular is MySQL, which is included in the LAMP group, such as Apache, Python, Ubuntu or Linux, however it can also be used on most platforms such as Windows or Mac.
If your computer has an Ubuntu operating system and it includes MySQL and you want to uninstall it for some reason, to do this is through certain steps that we will leave below.
You should check this before uninstalling MySQL on Ubuntu 21.04
MySQL is a language designed for database management If you want to uninstall it, it is very easy to do so, but first you need to check the following:
Check the Ubuntu version
The first thing you need to do is check to see if your computer has it version of Ubuntu or Linux 21.04, To do this, follow these steps:
If you are going to check it through the interface
- You should open the Ubuntu application on your computer.
- Find the settings or settings window and click on it.
- In the configuration you will get various options, click on the one that says details.
- Once you get to the details, you will get the version of Ubuntu that you have in this case, it must be 21.04.
If you are going to check the Ubuntu version, but through the terminal, follow these steps:
- Open the terminal that is in the applications, then in> accessories and finally> terminal. You can also use the terminal shortcut, which is by clicking the Ctrl + Alt + T keys.
- When you have the terminal open you have to write the command Isb_release -a.
- The version may not appear with this command, if so, try these others:cat / proc / versioncat / etc / issuecat / etc / lsb-release
- Finally, one of these commands will show you the version of Ubuntu or Linux that is running. If your computer has an old version on the screen, you can upgrade Ubuntu from the same terminal.
Check the status of MySQL
To check the status of MySQL is very easy, just type the following command in the terminal: Sudo systemctl status mysql. Once you have written the previous command, it should show you that the current status of MySQL is active. That means it’s running.
Here are the steps to uninstall MySLQ in Ubuntu 21.04
- Make sure your computer has Ubuntu 21.04, for this you can do it by two methods mentioned above.
- You need to check the status of MySQL, previously mentioned and the command you should use.
- After making comparisons if your computer has Ubuntu 21.04 and MySQL status, you should continue to remove Ubuntu with the following command sudo apt autoremove.
- After typing the command, you must click S to confirm the process.
- The next thing you should do is remove the residual files and to do this you have to write the order that we will leave you later.
- To finish, the last thing you should do is delete the files from the directory, the steps and the command to do so will be left to you later.
It should be noted that if uninstall MySQL from your computer and in the future you want to reinstall it, you will still be able to access the data you have saved, in case you are not interested in saving the documents, you need to delete the MySLQ database.
How to remove residual MySLQ packages from Ubuntu 21.04?
Once you have uninstalled Ubuntu 21.04, there are often residual files that take up unnecessary space, and removing them is very simple, here we will tell you what you should do.
- Back in the terminal.
- You must type the following command: sudo apt autoclean.
- With this, there will be no more residual or garbage packages.
- This other command that we will leave below is used to remove Ubuntu and residual packages together: sudo apt remove – purge mysql-server
- If there are still unwanted packages, try again with the above command.
Ubuntu or Linux being a open source operating system, gives us the opportunity to control the entire operating system, but for this you need to have some knowledge in some areas. Like the commands I mentioned in this article, there are also system information commands with which you can have full control.
So you can delete the files from the MySQL directory in Ubuntu 21.04
After removing the residual or unwanted packages, to remove the files from the Ubuntu or Linux MySQL directory you just need to type the following command: sudo rm -rf / var / lib / mysql.