- How To Install mariadb-server on Kali Linux
- What is mariadb-server
- Install mariadb-server Using apt-get
- Install mariadb-server Using apt
- Install mariadb-server Using aptitude
- How To Uninstall mariadb-server on Kali Linux
- Uninstall mariadb-server And Its Dependencies
- Remove mariadb-server Configurations and Data
- Remove mariadb-server configuration, data, and all of its dependencies
- Dependencies
- References
- Summary
- How to Install MariaDB 10.7 on Kali Linux
- 1. Update Kali Linux
- 2. Add MariaDB Repository
- 3. Download MariaDB 10.7
- 4. Install MariaDB 10.7 on Kali Linux
- 5. Fixing Error in MariaDB 10.7
- 6. Start MariaDB on Kali Linux
- 7. Secure MariaDB Installation on Kali Linux
- 8. Uninstall MariaDB from Kali Linux
How To Install mariadb-server on Kali Linux
In this tutorial we learn how to install mariadb-server on Kali Linux.
What is mariadb-server
This is an empty package that depends on the current “best” version of mariadb-server (currently mariadb-server-10.5), as determined by the MariaDB maintainers. Install this package if in doubt about which MariaDB version you need. That will install the version recommended by the package maintainers.
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query language in the world. The main goals of MariaDB are speed, robustness and ease of use.
There are three methods to install mariadb-server on Kali Linux. We can use apt-get , apt and aptitude . In the following sections we will describe each method. You can choose one of them.
Install mariadb-server Using apt-get
Update apt database with apt-get using the following command.
After updating apt database, We can install mariadb-server using apt-get by running the following command:
Install mariadb-server Using apt
Update apt database with apt using the following command.
After updating apt database, We can install mariadb-server using apt by running the following command:
Install mariadb-server Using aptitude
If you want to follow this method, you might need to install aptitude on Kali Linux first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.
After updating apt database, We can install mariadb-server using aptitude by running the following command:
How To Uninstall mariadb-server on Kali Linux
To uninstall only the mariadb-server package we can use the following command:
Uninstall mariadb-server And Its Dependencies
To uninstall mariadb-server and its dependencies that are no longer needed by Kali Linux, we can use the command below:
Remove mariadb-server Configurations and Data
To remove mariadb-server configuration and data from Kali Linux we can use the following command:
Remove mariadb-server configuration, data, and all of its dependencies
We can use the following command to remove mariadb-server configurations, data and all of its dependencies, we can use the following command:
Dependencies
References
Summary
In this tutorial we learn how to install mariadb-server package on Kali Linux using different package management tools: apt , apt-get and aptitude .
How to Install MariaDB 10.7 on Kali Linux
MariaDB is an enterprise-level relational database management system. It is an open-source database similar to MySQL—a project by Oracle. MariaDB is not only robust but also highly compatible. It is essential to learn how to install MariaDB 10.7 on Kali Linux.
With its wide community, MariaDB is stable and maintains high compatibility with Oracle’s MySQL. In this article, we will cover how to install MariaDB on Kali Linux. Before we start with the installation, let’s look at some of the new improvements in MariaDB:
- New Universally Unique Identifiers (UUID) Data Types.
- Natural sort for string sorting in alphabetical order.
- Python-like format functions.
- InnoDB Bulk insert for bulk insert and building indexes.
- New password validation plugin called Password Reuse.
- Affected row identification using Diagnostics Property.
These are some of the prominent properties in the new MariaDB update. Let’s start with the setup of MariaDB on Kali Linux machines.
1. Update Kali Linux
First, update your Kali Linux system before starting with the installation of MariaDB. You can update the packages by using the apt update command as shown below:
If updates are available, then perform the upgrade. For example:
You should get a similar output:
Alternatively, you can also use this command:
After that, reboot your system using the reboot command if required. To check if a reboot is required after the upgrade, execute the following command:
[ -f /var/run/reboot-required ] && sudo reboot -f
Or you can simply use the reboot command:
2. Add MariaDB Repository
Secondly, we will add MariaDB Repository in the Kali package manager. Execute the commands given below to add the MariaDB package:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 echo "deb [arch=amd64] http://mariadb.mirror.liquidtelecom.com/repo/10.6/debian bullseye main" | sudo tee /etc/apt/sources.list.d/mariadb.list
You should get a similar output seen below:
3. Download MariaDB 10.7
After that, we will add the dependency packages to our repository like any other Debian system. To install dependency packages, execute the following command:
sudo apt install wget curl gpg gnupg2 software-properties-common apt-transport-https lsb-release ca-certificates dirmngr
Press “Y” to continue with the installation.
Next, download the MariaDB script for Linux OS machines from its website. Alternatively, you can also use the wget command to download the MariaDB setup. For example:
wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
This is what the installation would look like in your screen:
To access the help page of this script, run it with the bash command followed by the —help flag. For instance:
sudo bash mariadb_repo_setup --help
You should then get a similar output as this one:
Next, we will set the OS type and command options as Kali Linux. We are doing this because Kali Linux is not on the list of distributions supported by MariaDB. For this step, we will edit the MariaDB bash script using the bash command.
sudo bash mariadb_repo_setup --os-type=debian --os-version=bullseye
You will get a similar output:
Notice here that this file consists of the required MariaDB configurations for any operating system. We will modify it for Debian distribution and its bullseye version. After that, add the MariaDB Server version using the same sudo bash command. Use the following command specifically:
sudo bash mariadb_repo_setup --mariadb-server-version=10.7
Hence, the new configured MariaDB script for Kali Linux has been created.
Next, we will confirm that this script is functional by using the cat command. For example:
cat /etc/apt/sources.list.d/mariadb.list
Here is what it should look like:
After that, update your system to ensure the changes.
4. Install MariaDB 10.7 on Kali Linux
Finally, we are ready to install MariaDB on Kali Linux. For this step, use the apt-cache command. For example:
sudo apt-cache policy mariadb-server
You should then get a similar output as this:
Now, install MariaDB server and client packages together on Kali Linux. For this step, use the apt install command. Which is:
sudo apt install mariadb-server mariadb-client
You will get a similar output:
To confirm the installation of MariaDB, use the –version flag with mariadb. For instance:
This is the output you should get:
5. Fixing Error in MariaDB 10.7
Type in these commands, In case you encounter errors similar to the ones given below:
“ mariadb-server-core-10.7 : Depends: liburing1 (>= 0.7) ” or “ The following packages have unmet dependencies: ”, you will have to install the package manually. For this step, use the wget command to get the required dependencies.
wget http://ftp.us.debian.org/debian/pool/main/libu/liburing/liburing1_0.7-3~bpo10+1_amd64.deb
After that, install the downloaded package. For example:
sudo dpkg -i liburing1_0.7-3~bpo10+1_amd64.deb
Next, install MariaDB again using the apt install command as follows:
sudo apt install mariadb-server mariadb-client
You should be getting a similar output as this:
If there are unrequired packages, then remove them using the apt autoremove command. Specifically:
6. Start MariaDB on Kali Linux
Now, we will enable the MariaDB service and start it. For both the actions, we will use the systemctl command. For example:
sudo systemctl enable mariadb sudo systemctl start mariadb
You should be getting a similar output as this:
Next, check the status of the service running. To do this, input the command:
You should be getting a similar output as this:
7. Secure MariaDB Installation on Kali Linux
Lastly, we will secure MariaDB installation by using the mariadb-secure-installation as shown below:
sudo mariadb-secure-installation
You should get similar results as this:
Type “Y” in the authentication section. Next, it will ask you to change the root password. Type “Y” and enter the new password. Hit “Y” in the rest of the options. After that, check the new authentication. You will get an access denied message.
To fix this, type the following command:
The -p flag will provide the password option. Here, we can add the password that we have just set.
Now, your output would look like this:
To exit from MariaDB, type exit and hit “Enter key”.
Finally, you have installed and used MariaDB on Kali Linux successfully.
8. Uninstall MariaDB from Kali Linux
To uninstall MariaDB from Kali Linux, we will first remove its server and clean all the packages. For this step, execute the purge command as seen below:
sudo apt purge mariadb-server
Secondly, we will remove all the data related to the database. This is stored in /var/lib/mysql/ directory. So we will delete that using the rm command, which should look like this:
Next, we will remove the client package and dependencies related to this package. Use the apt autoremove command. For example:
sudo apt autoremove mariadb-server mariadb-client
And finally, you have uninstalled MariaDB from Kali Linux.
And that marks the end of this guide. Now you have learned how easy it is to install and use MariaDB on Kali Linux, and you also found out how to secure your MariaDB installation using a password. We hope this article was helpful to you. For more information on MariaDB, check out its official documentation.
If this guide helped you, please share it.
Sidrah is a staff writer at Distroid and has a Masters in Computer Science, with her key two focus areas being SQL and DevOps. She has written over 100 posts and specializes in all things Linux. She also has experience trying out various other distros, BASH scripting, Git, and software testing. LinkedIn GitHub
Leave a Reply
You must be logged in to post a comment.