Vibes Host Doc's & FAQ
  • Welcome to Vibes Host Doc's & FAQ
  • General Technical Questions
    • Windows
      • Change VPS Password
      • How to connect to your windows VPS
      • Open Windows Firewall Ports
      • Setup MariaDB on Windows Server
      • Disable Windows Update
    • Linux
      • Change user password
      • Install MariaDB on Linux
    • AntiDDos Firewall Managment
      • Path.net
  • Games
    • Rust
      • How to protect your Rust server
    • Minecraft
    • GTA ROLEPLAY
  • VPS DASHBOARD MANAGMENT
    • About the new Vibes Dashboard
      • Change the OS
      • Enable 2FA
  • Discord
  • Support Ticket
  • Youtube Videos
Powered by GitBook
On this page

Was this helpful?

  1. General Technical Questions
  2. Linux

Install MariaDB on Linux

Learn how to install mariadb service on different linux distributions

This documentation has been extracted from mariadb oficial page

This guide will walk you through the steps to install MariaDB 11.4.3 on a Linux system based on Debian (such as Ubuntu, Debian itself, or other derivatives). MariaDB is an open-source relational database system that is a popular choice for many web applications.


Prerequisites

  • A running Debian-based system (e.g., Ubuntu 22.04, Debian 11).

  • Root or sudo access.

  • A stable internet connection for package downloads.

Step-by-Step Installation Guide

1. Update Your System

First, make sure your package lists are up to date.

sudo apt update
sudo apt upgrade -y

2. Install Prerequisites

MariaDB requires some dependencies to be installed on your system, like software-properties-common to manage repositories.

sudo apt install software-properties-common dirmngr -y

3. Add the MariaDB 11.4 Repository

To install the latest version of MariaDB (11.4.3), you need to add the official MariaDB repository to your system.

  1. Import the MariaDB GPG key:

    sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
  2. Add the MariaDB repository:

    sudo add-apt-repository 'deb [arch=amd64] https://mirror.mariadb.org/repo/11.4/debian bullseye main'

    If you're using a different Debian-based distribution, replace bullseye with your version codename (e.g., focal for Ubuntu 20.04).

4. Update Package Lists Again

After adding the MariaDB repository, update your package list to include the new packages from MariaDB:

sudo apt update

5. Install MariaDB 11.4.3

Now you can install MariaDB 11.4.3 using the following command:

sudo apt install mariadb-server mariadb-client -y

6. Start and Enable MariaDB Service

After installation, start the MariaDB service and enable it to automatically start on system boot:

sudo systemctl start mariadb
sudo systemctl enable mariadb

7. Secure the MariaDB Installation

MariaDB includes a security script to remove default settings that are insecure. Run this script:

sudo mysql_secure_installation

You will be prompted to:

  • Set a root password (if not set during installation).

  • Remove anonymous users.

  • Disallow remote root login.

  • Remove the test database.

  • Reload privilege tables.

Answer "Y" to all prompts for a secure installation.

8. Verify Installation

To verify that MariaDB is correctly installed and running, use:

sudo systemctl status mariadb

You should see the service status as "active" (running).

Additionally, log into the MariaDB shell:

sudo mariadb -u root -p

Enter the root password you created earlier, and you'll be logged into the MariaDB shell. To confirm the version, run:

SELECT VERSION();

You should see something like:

+----------------+
| VERSION()      |
+----------------+
| 11.4.3-MariaDB |
+----------------+

9. Basic Configuration (Optional)

You can configure MariaDB by editing the my.cnf configuration file:

sudo nano /etc/mysql/my.cnf

Make any changes you need, then restart the service:

sudo systemctl restart mariadb

Common Commands

  • Start MariaDB:

    sudo systemctl start mariadb
  • Stop MariaDB:

    sudo systemctl stop mariadb
  • Restart MariaDB:

    sudo systemctl restart mariadb
  • Check MariaDB Status:

    sudo systemctl status mariadb

This guide will help you install MariaDB 11.4.3 on a CentOS system, including CentOS 7, CentOS 8, or CentOS Stream. MariaDB is a widely-used relational database system, known for its speed and reliability.


Prerequisites

  • A running CentOS system (CentOS 7, CentOS 8, or CentOS Stream).

  • Root or sudo access.

  • Internet connection for package downloads.


Step-by-Step Installation Guide

1. Update Your System

Before beginning, update your system packages to ensure everything is up-to-date:

sudo yum update -y

2. Add the MariaDB 11.4 Repository

MariaDB 11.4 is not available by default in the CentOS repositories, so we need to add the MariaDB official repository.

  1. Create a repository file:

    sudo nano /etc/yum.repos.d/MariaDB.repo
  2. Add the following content based on your CentOS version:

For CentOS 7:

[mariadb]
name = MariaDB
baseurl = https://mirror.mariadb.org/repo/11.4/centos7-amd64
gpgkey=https://mariadb.org/mariadb_release_signing_key.asc
gpgcheck=1

For CentOS 8 / Stream:

[mariadb]
name = MariaDB
baseurl = https://mirror.mariadb.org/repo/11.4/centos8-amd64
gpgkey=https://mariadb.org/mariadb_release_signing_key.asc
gpgcheck=1
  1. Save and exit the file by pressing CTRL + X, then Y, and Enter.

3. Install MariaDB 11.4.3

Now that the MariaDB repository is added, you can install MariaDB 11.4.3.

sudo yum install MariaDB-server MariaDB-client -y

4. Start and Enable MariaDB Service

Once the installation is complete, start MariaDB and enable it to start on boot:

sudo systemctl start mariadb
sudo systemctl enable mariadb

You can check if the service is running correctly:

sudo systemctl status mariadb

The status should be "active (running)".

5. Secure MariaDB Installation

MariaDB includes a script to secure the installation by removing insecure default settings. Run the script to improve security:

sudo mysql_secure_installation

You'll be prompted to:

  • Set a root password (if not already set).

  • Remove anonymous users.

  • Disallow root remote login.

  • Remove the test database.

  • Reload privilege tables.

Answer "Y" to all prompts for better security.

6. Verify Installation

To verify the installation of MariaDB 11.4.3, log into the MariaDB shell:

sudo mysql -u root -p

Enter the root password, and you'll be logged in. To check the installed version, run:

SELECT VERSION();

This should output something like:

+----------------+
| VERSION()      |
+----------------+
| 11.4.3-MariaDB |
+----------------+

7. Firewall Configuration (Optional)

If your server uses firewalld, you'll need to allow MariaDB service through the firewall to allow external connections.

sudo firewall-cmd --permanent --add-service=mysql
sudo firewall-cmd --reload

8. Basic Configuration (Optional)

You can configure MariaDB by editing its main configuration file, typically located at /etc/my.cnf or /etc/my.cnf.d/. For example:

sudo nano /etc/my.cnf

Make any necessary changes and save. After making changes, restart MariaDB:

sudo systemctl restart mariadb

Common Commands

  • Start MariaDB:

    sudo systemctl start mariadb
  • Stop MariaDB:

    sudo systemctl stop mariadb
  • Restart MariaDB:

    sudo systemctl restart mariadb
  • Enable MariaDB at Boot:

    sudo systemctl enable mariadb
  • Check MariaDB Status:

    sudo systemctl status mariadb

PreviousChange user passwordNextAntiDDos Firewall Managment

Last updated 7 months ago

Was this helpful?

Page cover image