MariaDB is a popular open-source database management system that is a drop-in replacement for MySQL. It is widely used for its reliability, performance, and ease of use. In this article, we will guide you through the process of installing MariaDB on Ubuntu 24.04 step-by-step.
Step 1: Update Your System
Before installing any new software on your Ubuntu system, it is recommended to ensure that all packages are up to date. You can do this by running the following commands in the terminal:
sudo apt update
sudo apt upgrade
Step 2: Install MariaDB
To install MariaDB on Ubuntu 24.04, you can use the following command:
sudo apt install mariadb-server
During the installation process, you will be prompted to set a password for the root user. Make sure to choose a strong password and remember it as this will be required to access the MariaDB database.
Step 3: Secure your MariaDB Installation
To secure your MariaDB installation, you can run the following command:
sudo mysql_secure_installation
This command will prompt you to answer several questions to secure your MariaDB installation. You can choose to enable password validation, remove anonymous users, disallow root login remotely, and remove the test databases. It is recommended to answer ‘yes’ to all these questions to enhance the security of your database.
Step 4: Access MariaDB
After installing and securing MariaDB, you can access the database by running the following command:
sudo mysql -u root -p
Enter the root password that you set during the installation process. You should now have access to the MariaDB command line interface where you can create databases, tables, and perform various other database operations.
Step 5: Additional Steps (Optional)
If you would like to configure MariaDB to start automatically when your system boots up, you can use the following command:
sudo systemctl enable mariadb
Additionally, you can also install the MariaDB client to connect to and manage your databases from a remote server by running the following command:
sudo apt install mariadb-client
Congratulations! You have successfully installed MariaDB on Ubuntu 24.04. You can now start using MariaDB to manage your databases efficiently. If you encounter any issues during the installation process, refer to the official MariaDB documentation or seek help from the community forums.