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 on Debian 9 (Stretch)

    How To Install MariaDB on Debian 9 (Stretch)

    RahulBy RahulNovember 13, 20183 Mins ReadUpdated:October 31, 2019

    MariaDB is an enhanced, drop-in replacement for MySQL. MariaDB can be a better choice for database professionals looking for a robust, scalable, and reliable SQL server. MariaDB has a number of updated features over MySQL.

    Install MariaDB on Debian 9

    This article will help you to Install MariaDB 10.4 on Debian 9 (Stretch) via apt package manager.

    Step 1 – Prerequsiteis

    You can find the MariaDB Apt configuration file from the official website. Import the package singin key for MaraiDB packages on your system.

    sudo apt-get install software-properties-common dirmngr
    sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
    

    After this, create a new Apt configuration file for MariaDB with the following command. You can use any text editor than vim.

    sudo vim /etc/apt/sources.list.d/mariadb.list
    
    # MariaDB 10.4 for Debain 9
    deb [arch=amd64,i386,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.4/debian stretch main
    deb-src http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.4/debian stretch main
    

    Step 2 – Install MariaDB on Debian 9

    After adding the repository to your system and use the following commands to install MariaDB-server on your Ubuntu system. This will remove any previous version of MariaDB packages and install the latest packages on the system. Make sure you have proper backups of databases before running the below commands.

    sudo apt update
    sudo apt install mariadb-server
    

    This will also install other required dependencies on your system.

    While installing MariaDB using above command installer will prompt for MariaDB root account password. Enter a strong password as below.

    Setup MariaDB password Debian

    This will also ask for confirm password. Enter the same as above.

    Step 3 – Verify MariaDB Setup

    After the successful installation of MariaDB on the Debian 9 (Stretch) system. The installer will also start service during the install process. You can verify service by running the below command.

    MariaDB also creates a reference for service with name MySQL. You can change MariaDB with MySQL as per your choice.

    sudo systemctl status mariadb
    

    You will see the running status like:

    Then connect to MariaDB shell by running below command. You need to enter the password configured in the above step.

    mysql -u root -p
    
    Enter password:
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 8
    Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1
    
    Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]>
    

    Step 4 – Manage MariaDB Service

    Sometimes you need to stop or start MariaDB service. Use the following commands to stop, start, check status and restart MariaDB service.

    sudo systemctl stop mariadb.service      # To Stop MariaDB service 
    sudo systemctl start mariadb.service     # To Start MariaDB service 
    sudo systemctl status mariadb.service    # To Check MariaDB service status 
    sudo systemctl restart mariadb.service   # To Stop then Start MariaDB service 
    
    database debian Debian 9 mariadb MySQL
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install PostgreSQL 11 on Debian 9 (Stretch)
    Next Article How To Install MariaDB on Ubuntu 18.04

    Related Posts

    Setup Selenium with Python and Chrome on Ubuntu & Debian

    Updated:June 20, 20224 Mins Read

    How to Setup Squid Proxy Server on Ubuntu and Debian

    Updated:June 17, 20225 Mins Read

    Backup MySQL Databases to Amazon S3 (Shell Script)

    Updated:May 28, 20222 Mins Read

    How to Install MariaDB on Ubuntu 22.04

    Updated:May 28, 20222 Mins Read

    How To Install Linux, Nginx, MySQL, & PHP (LEMP Stack) on Ubuntu 22.04

    Updated:April 7, 20227 Mins Read

    How To Install MySQL Server on Ubuntu 22.04

    Updated:April 6, 20224 Mins Read

    2 Comments

    1. Proman on March 3, 2019 5:57 pm

      sudo systmectl status mariadb false
      sudo systemctl status mariadb right….. please change this THX

      Reply
      • Rahul on March 6, 2019 4:20 am

        Thanks Promoan. corrected the typo.

        Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • What is CPU? – Definition, Types and Parts
    • What is the /etc/aliases file
    • What is the /etc/nsswitch.conf file in Linux
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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