Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install MariaDB on Ubuntu 20.04 - DesignLinux

May 27 2020
designlinux 0 Comments

MariaDB is an open-source relational database management system. It was originally designed as a backward-compatible, binary drop-in replacement of MySQL.

MariaDB is developed and maintained by the original developers of MySQL and by the open-source community.

This guide explains how to install and MariaDB on Ubuntu 20.04.

Prerequisites #

We’re assuming that you have administrative access to the Ubuntu server, either as root or a user with sudo permissions.

Installing MariaDB on Ubuntu #

At the time of writing this article, the latest MariaDB version available in Ubuntu’s repositories is version 10.3. To install it run the following commands:

sudo apt updatesudo apt install mariadb-server

Once the installation is completed, the MariaDB service will start automatically. To verify that the database server is running, type:

sudo systemctl status mariadb

The output should show that the service is enabled and running:

● mariadb.service - MariaDB 10.3.22 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2020-05-20 16:52:07 UTC; 12s ago
     ...

That’s it. MariaDB has been installed, and you can start using it.

Login as root #

To interact with the MariaDB server from the command line, use the mysql client utility or its alias mariadb. This tool is installed as a dependency of the MariaDB server package.

On Ubuntu, MariaDB root user is authenticated by the auth_socket plugin by default. The plugin works by checking whether the local system user invoking the client program matches the specified MariaDB user name. This means that you can’t authenticate as root by providing a password.

To log in to the MariaDB server as the root user type:

sudo mysql

You will be presented with the MariaDB shell, as shown below:

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 61
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04

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)]> Bye

If you want to login to your MariaDB server as root using an external program such as phpMyAdmin, you have two options.

The first one is to change the authentication method from auth_socket to mysql_native_password. You can do that by running the following command:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'very_strong_password';FLUSH PRIVILEGES;

The second, recommended option is to create a new dedicated administrative user with access to all databases:

GRANT ALL PRIVILEGES ON *.* TO 'administrator'@'localhost' IDENTIFIED BY 'very_strong_password';

You can name the administrative user anything you want, but make sure you use a strong password.

Conclusion #

We have shown you how to install MariaDB on Ubuntu 20.04. Now that your database server is up and running, your next step could be to learn how to manage MariaDB user accounts and databases.

If you have any questions or feedback, feel free to leave a comment.

mariadb mysql ubuntu

Related

Tags: mariadb, mysql, ubuntu

Fdisk Command in Linux (Create Disk Partitions)

Prev Post

How to Install Webmin on Ubuntu 20.04

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 831
  • 615,203

DesignLinux.com © All rights reserved

Go to mobile version