How to install MariaDB database on Linux?

The steps for installing the MariaDB database on a Linux system are as follows:

  1. Open the terminal and log in as the root user.
  2. Ensure the system is updated to the latest version by running the following command for updates:
apt-get update
  1. Run the following command to install the MariaDB server:
apt-get install mariadb-server
  1. During the installation process, you will be prompted to set a root user password. Please set a secure password.
  2. After installation is complete, you can run the following command to start the MariaDB service:
systemctl start mariadb
  1. To automatically start the MariaDB service on boot, you can run the following command:
systemctl enable mariadb
  1. Next, execute the following command to enhance the security of MariaDB:
mysql_secure_installation
  1. This will guide you through completing some necessary security settings, such as deleting anonymous users, disabling remote root login, etc.

At this point, you have successfully installed the MariaDB database on your Linux system. You can use the following command to log in to MariaDB:

mysql -u root -p

Enter the root password you set during the installation process to log in.

bannerAds