How To Install and Configure MariaDB on Centos/RedHat
- Last Updated On: July 12, 2019
- By: Scriptcrunch Editorial
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
Scriptcrunch Editorial
Other Interesting Blogs
[50% OFF] Kubernetes Certification Coupons (CKA, CKAD, CKS, KCNA and KCSA)
Looking for CKA coupon and other Kubernetes certification coupon codes? You have come to the right place. Following are the list of
[80% OFF] Linux Foundation Coupon for December 2024
Looking for CKA Coupon and other Linux Foundation certifications coupons? We got you covered. With the latest Linux Foundation Coupon, you can
[65% 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