Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Databases»MariaDB»How to Install MariaDB 10.7 on Ubuntu 20.04

    How to Install MariaDB 10.7 on Ubuntu 20.04

    RahulBy RahulMay 20, 20204 Mins ReadUpdated:April 19, 2022

    MariaDB is an open-source relational database server. Which is made by the original developers of MySQL. MariaDB intended to maintain high compatibility with the MySQL server, APIs, and commands.

    This tutorial will help you to install the MariaDB on Ubuntu 20.04 LTS system.

    Prerequisites

    • Running Ubuntu 20.04 system
    • Login access with root or sudo privileged account

    Step 1 – Setup Repository

    The Default packages repositories contain old versions of the MariaDB server. So, it will be good to use the official repository, which provides the latest version of packages.

    First, add the package signing key to your system by running commands:

    sudo apt install software-properties-common
    sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
    

    Then, create a apt configuration file on your Ubuntu system. To create file run command:

    sudo nano /etc/apt/sources.list.d/mariadb.list
    

    Add the below snippet

    # MariaDB 10.4 Repository
    deb [arch=amd64] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.4/ubuntu focal main
    deb-src http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.4/ubuntu focal main
    

    Save file and close.

    Step 2 – Install MariaDB on Ubuntu

    The official MariaDB repository contains the latest version of MariaDB server packages.

    Once you added the package repository, run the following commands to install MariaDB server packages and required dependencies.

    sudo apt update
    sudo apt install mariadb-server
    

    The above command will install the MariaDB server, client tools, and other required packages on your system.

    Step 3 – Post Installation Setup

    MariaDB package provides a command-line utility to complete post-installation steps. This includes configuring a password for the root user and removing unnecessary databases from the default installation.

    To run the MariaDB post installation wizard, type:

    sudo mysql_secure_installation
    

    A wizard will prompt for some inputs to set up the MariaDB root user password. Secure your MariaDB installation by removing anonymous users, disabling root login from a remote host, and removing test databases.

    A preferred choice is to say yes (‘y’) for all the question:

    • Enter current password for root (enter for none): [ JUST PRESS ENTER ]
    • Set root password? [Y/n] y
    • New password: [ ENTER A SECURE PASSWORD ]
    • Re-enter new password: [ CONFIRM YOUR PASSWORD ]
    • Remove anonymous users? [Y/n] y
    • Disallow root login remotely? [Y/n] y
    • Remove test database and access to it? [Y/n] y
    • Reload privilege tables now? [Y/n] y

    Step 4 – Connect to MariaDB

    MariaDB packages provide a command-line utility to connect database servers via the command line. Where you can completely manage your database server.

    To connect MariaDB server run below command on terminal:

    mysql -u root -p
    

    Enter the password for the root account configured in the above step.

    Enter password:
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 57
    Server version: 10.4.13-MariaDB-1:10.4.13+maria~focal-log mariadb.org binary distribution
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]>
    

    Step 5 – Manage Mariadb Service

    The latest version of Ubuntu systems uses systemd to manage services. You can use the following commands to manage the MariaDB service on your system.

    sudo systemctl start mariadb         # To start service 
    sudo systemctl stop mariadb          # To stop service 
    sudo systemctl status mariadb        # To check status of service 
    sudo systemctl restart mariadb       # To stop and then start service 
    

    Step 6 – Create Database and User (Optional)

    This is an optional step for you. The below commands help you to create a database, a user, and assign privilege to the user on the database.

    To use the below commands, first, you must be connected to the MariaDB server via the command line.

    MySQL
    1
    2
    3
    4
    CREATE DATABASE mydb;
    CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'my_secure_password';
    GRANT ALL ON mydb.* TO 'myuser'@'localhost';
    FLUSH PRIVILEGES;

    Conclusion

    In this tutorial, you have learned about to install MariaDB on Ubuntu Linux system. Next, you can install phpMyAdmin to administer MySQL server via web based interface.

    database mariadb RDMS
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install Apache Maven on Ubuntu 20.04
    Next Article How to Install Dovecot on Ubuntu 20.04

    Related Posts

    How To Install MySQL Server on Ubuntu 22.04

    Updated:April 6, 20224 Mins Read

    How To Install MariaDB on Debian 11

    4 Mins Read

    How to Install Redis on Debian 11 Linux

    Updated:September 16, 20213 Mins Read

    How to Check the PostgreSQL Version

    Updated:August 6, 20212 Mins Read

    How to Rename MySQL Database

    Updated:July 26, 20213 Mins Read

    How to Backup SQL Server Database

    Updated:June 28, 20212 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    • (Resolved) Please install all available updates for your release before upgrading
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.