MariaDB Installation Process and Configuration in RHEL-7


rpm -qa | grep mariadb

yum groupinstall mariadb -y

firewall-cmd --permanent  --add-services=mysql
firewall-cmd --reload

systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb

mysql_secure_installation

Login:
=====
mysql -u user_name -p user_password

Show Database:
==============
show databases;


Create Database:
==================
create database database_name;


select specific database:
=========================
use database_name;


Create Table:
=============
create table table_name ( id varchar(10), name varchar(100), contact varchar(11));






Insert into database:
=====================
insert into table_name values ( '01', 'Mushfiq', '01982672499');


Select from table:
==================
select * from table_name;


Create Use:
===========
create user user_name@localhost identified by "User_password";


Give specific permission:
=========================
grant select, insert on database_name.* to user_name@localhost;
flush privileges;


Update the database table:
==========================
update table_name set name='mushfiqur rahman' where id='01';


Revoke the Permission:
=====================
revoke insert on database_name.* from user-name@localhost;
flush privileges;


Backup:
=======
mysqldump -u root -p database_name > /root/Desktop/backup_2018.dump

Restore Database:
=================
create database test;
show tables;
exit

*** mysql -u root -p test </root/Desktop/backup_2016.dump

Comments

  1. Red Prism Group is one of the best Data Science coaching in Noida, offering services from training to placement as part of the Data Science training program.

    ReplyDelete

Post a Comment

Popular posts from this blog

Some Questions for MTCNA Exam

ডিপ্লোমা লেভেল এর ইন্ডাস্ট্রিয়াল এটাচমেন্ট এ আসার পূর্বে একটু ভেবে আসার অনুরোধ রইলো

Basic Router & Switch IOS commands