MariaDB is a popular open-source relational database management system. It is a fork of MySQL and is widely used in web applications. In this section, we will show you how to install MariaDB on Ubuntu 22.04.
Before installing MariaDB, it is recommended to update the system packages to their latest versions. You can do this by running the following command in your terminal:
sudo apt update
Next, you need to install the packages required for installing MariaDB. You can do this by running the following command:
sudo apt-get install wget software-properties-common dirmngr ca-certificates apt-transport-https -y
Once the packages are installed, you can install MariaDB by running the following command:
sudo apt install mariadb-server mariadb-client
This command will start the MariaDB installation process and prompt you to set a root password, remove anonymous users, disallow root login remotely, and remove test databases.
You can answer the prompts according to your preferences.
After installing MariaDB, you can check the version of MariaDB by running the following command:
You can check the status of MariaDB by running the following command:
sudo systemctl status mariadb
This command will show you whether MariaDB is running or not.
You can execute the MariaDB script by running the following command:
This command will open the MariaDB shell, where you can execute SQL commands.
You can log in to MariaDB by running the following command:
sudo mysql -u root -p
This command will prompt you to enter the root password you set during the installation process.
You can create a database by running the following command:
CREATE DATABASE net2database;
This command will create a database named “net2database”.
You can view the database by running the following command:
This command will show you a list of all the databases on your MariaDB server.
Step 11: Quit MariaDB
Finally, type quit in the terminal to log out from the currently active MariaDB shell.
If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.