How to install MariaDB on CentOS 8

MariaDB is an open source relational database management system, which is backward compatible and can replace MySQL. It was jointly developed by some of the original developers of MySQL and many community members.

In this article, we will explain how to install and protect MariaDB 10.3 on CentOS 8.

1. Install MariaDB on CentOS 8

At the time of writing this article, the MariaDB version available in the CentOS 8 source repository is 10.3.

Run the following command as a root user or another user with sudo privileges to install MariaDB 10.3 on CentOS 8.

sudo dnf install @mariadb

The mariadb module can install MariaDB and all dependent packages.

Once the installation is complete, start the MariaDB service, and start the boot, enter:

sudo systemctl enable --now mariadb

To verify that the MariaDB server is running, enter:

sudo systemctl status mariadb

The output shows that the service is active and enabled:

● mariadb.service - MariaDB 10.3 database server
 Loaded:loaded(/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
 Active:active(running) since Sun 2019-12-0821:05:26 UTC; 15s ago
   ...

Second, protect MariaDB

MariaDB server has a script called mysql_secure_installation, which can perform the following security-related operations and set the root user password:

Run the following script:

sudo mysql_secure_installation

You will be prompted to set the password of the MariaDB root user. Once you are done, this script will ask you to remove anonymous users, restrict root user access to the local machine, and remove the test database. For all questions, you should answer "Y" (yes).

And that's all. You have installed and protected MariaDB on your CentOS server, and you are ready to use it.

Three, connect to MariaDB Shell

To connect to the MariaDB server through the terminal, enter:

mysql -u root -p

When prompted, enter the root user password, and the MariaDB shell window will display as follows:

Welcome to the MariaDB monitor.  Commands end with; or \g.
Your MariaDB connection id is 18
Server version:10.3.11-MariaDB 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)]>

Four, summary##

In this guide, we showed you how to install and secure MariaDB on CentOS 8, and how to connect to MariaDB server from the terminal command line.

Now that your MariaDB server is up and running, you can connect to the MariaDB shell and start creating databases and users.

CentOS 8 also provides MySQL 8.0. If you want to install MySQL instead of MariaDB, you can browse: How to install MySQL on CentOS 8. Please note that you are not installing MariaDB and MySQL on the same server at the same time.

Recommended Posts

How to install MariaDB on CentOS 8
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
How to install Memcached on CentOS 8
How to install R on CentOS 8
How to install Virtualbox on CentOS 8
How to install TensorFlow on CentOS 8
How to install TeamViewer on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install Gradle on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
How to install GCC on CentOS 8
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8
How to install Webmin on CentOS 8
How to install Ruby on CentOS 8
How to install Skype on CentOS 8
How to install htop on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Postgresql on CentOS 8
How to install MariaDB on Ubuntu 20.04
How to install Wordpress on Centos
How to install TeamViewer on CentOS 8
How to install MongoDB on CentOS 7
How to install Odoo 13 on CentOS 8
How to install Apache on CentOS 8
How to install OpenCV on CentOS 8
How to install PHP on CentOS 8
How to install MongoDB on CentOS 8
How to install Apache Maven on CentOS 8
How to install Apache Kafka on CentOS 7
[Graphic] How to install tomcat on centos
R&D: How To Install Python 3 on CentOS 7
How to install GCC compiler on CentOS 7
How to install offline JDK1.8 on centos7.0
How to install and configure Elasticsearch on CentOS 7
How to install Visual Studio Code on CentOS 8
How to install and use Docker on CentOS 7
How to install RPM packages on CentOS Linux
How to install and use Composer on CentOS 8
How to install and configure Redis on CentOS 8
How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511
How to install and configure phpMyAdmin on CentOS 6
How to install and use Curl on CentOS 8
How to install and configure Owncloud on CentOS 8
How to install VirtualBox client extension on CentOS 8
How to install Docker CE on RHEL 8 / CentOS 8
How to install and uninstall tomcat on centos
How to install and configure Redmine on CentOS 8
How to install Memcached on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04