
How To Install and Configure MariaDB on Centos/RedHat
- Last Updated on: July 12, 2019
- By: scriptcrunch
I want to install MariaDB on Redhat. How do I install MariaDB from command Line?
About MariaDB: It is an open-source database solution.
MariaDB Quick Installation on Centos/Redhat
Step 1: Install MariaDB server and client
sudo yum install mariadb-server mariadb -y
Step 2: Start and enable MariaDB services
sudo systemctl start mariadb sudo systemctl enable mariadb
Step 3: Check the status of MariaDB service
sudo systemctl status mariadb
How to Secure MariaDB Installation
Set password for your MySQL instance using the following command. The command will prompt for the current root password, you can hit enter as there is no default password. All the other prompts are self-explanatory.
sudo mysql_secure_installation
How To Login To MariaDB server From CLI
Login using MySQL client terminal using the root password using mysql command.
mysql -u root -p
How To Create a MariaDB User and a Database
Step 1: Create a user named myuser
. Replace s3cret
with a required strong password.
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 's3cret';
Step 2: Create a db named mydb.
CREATE DATABASE mydb;
How To Grant Privileges To a MariaDB Database User
Step 1: Grant all privileges on the mydb
database to the myuser
user.
GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'localhost';
Step 2: Flush the privileges and exit the MySQL terminal.
FLUSH PRIVILEGES;
exit
Other Interesting Blogs

CKA Exam Study Guide: Certified Kubernetes Administrator
Passing the cloud-native Certified Kubernetes Administrator (CKA) exam is not a cakewalk. To pass the CKA exam, you should have enough hands-on

Linux Foundation Coupon for 2023
Hi Techies, I wanted to let you know about a pretty sweet deal with the Linux Foundation Coupon that is running now.

[35% OFF] Linux Foundation LFCA, LFCS & LFCT Exam Voucher Codes
Linux Foundation has announced up to a $284 discount on its Linux certification programs Linux Foundation Certified IT Associate (LFCA) and Linux