Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install MariaDB on Ubuntu 22.04 - DesignLinux

Nov 24 2022
designlinux 0 Comments
how-to-install-mariadb-on-ubuntu-22-04

MariaDB is an open-source and multi-threaded database management system which used as alternate of MySQL in LAMP stack. It’s developed by some of the original developers of the MySQL. This tutorial covers how to install MariaDB on Ubuntu 22.04.

Prerequisites#

  • You must logged in as root or non-root sudo enabled user account.

How to Install MariaDB on Ubuntu 22.04#

Perform the following instructions to install MariaDB on your Ubuntu 22.04 system:

Step 1 – Update System Packages

At first, you need to update the system packages using below command:

sudo apt update

It will update all the packages.

Step 2 – Install Required Packages

Using below given command you can install required packages for MariaDB installation:

sudo apt-get install wget software-properties-common dirmngr ca-certificates apt-transport-https -y

Step 3 – Install MariaDB

By default, Ubuntu 22.04 APT repositories includes MariaDB package. At the time of writing this article the latest version in ubuntu repository is 10.6.7.

To install MariaDB server and client packages issue the below given command:
sudo apt install mariadb-server mariadb-client

Installation may take few minutes to complete, depends on your server configuration.

It will start automatically MariaDB service.

Step 4 – Securing MariaDB

To increase security of MariaDB installation run the included security script. This will remove less secure default options such as root remote login and remove sample users. Run the below command :

sudo mysql_secure_installation

First, it will prompt you to enter current root user password. Next, it will ask you weather you want to change or set password for root. Press N and hit Enter key. After that it will prompt series of questions, press Y and hit Enter to accept the defaults for all the subsequent questions.

This will remove some anonymous users and the test database, disable remote root logins, and load these new rules so that MariaDB immediately respects the changes you have made.

Step 5 – Verify MariaDB

Execute below given command to check MariaDB service status:

sudo systemctl status mariadb

It will show output something like this:

● mariadb.service - MariaDB 10.6.7 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-11-19 06:25:55 UTC; 12min 45s ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
...

Step 6 – Connect to MariaDB

You can connect MariaDB server through the terminal by typing:

sudo mariadb

It will show MariaDB shell.

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.6.7-MariaDB-2ubuntu MariaDB Server

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 7 – Flush Privileges

Before going ahead, it’s recommended to flush all privileges using below given command:

flush privileges;

Conclusion#

This tutorial shown you how to install and secure MariaDB on a Ubuntu 22.04 server.

If you have any question or suggestion, please leave comment below.

Related

Tags: database, mariadb, ubuntu

How to Install Elasticsearch on Debian 11

Prev Post

How to Install Google Chrome on Debian 11

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
  • 2
  • 591
  • 1,055,363

DesignLinux.com © All rights reserved

Go to mobile version