Maria DB Installation in Linux Step by Step Guide
Maria DB is a fork of MySQL. Maria DB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. Development is led by some of the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle Corporation. Maria DB Installation in Linux Step by Step Guide.
Maria DB Features
- Maria DB is open-source relational database software.
- It is a great alternative or drop-in replacement for MySQL.
- It is free and easy to use.
- Maria DB is fast, Salable and robust, with a rich ecosystem of storage engines
- Maria DB New features include GIS and JSON support
- A non-blocking client API library
- The Aria and XtraDB storage engines with enhanced performance
- Better server status variables, and enhanced replication.
- API and ABI compatibility with MySQL
MariaDB Server Provide and Configuration Files
- Packages Required: MariaDB, MariaDB-server, and MariaDB-libs
- Daemon Name: MariaDB
- Port Number: 3308
- Config File: /etc/my.cnf
Configure the Repository to Install Maria DB
In order to config yum repo edit
# vi /etc/yum.repos.d/maria.repo [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.2/rhel7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 :wq
Install required packages for maria DB
# yum install mariadb*
Enable & Start MariaDB Services
Completion of installation, enable service to start on boot.
# systemctl enable mariadb.service # systemctl start mariadb.service
Verify service listing state
# ss -tulnp |grep mysqld
Allow ports for client communication remotely
# firewall-cmd --permanent --add-service=mysql # firewall-cmd --reload
Run initial configuration to secure
# mysql_secure_installation Enter current password for root (enter for none): Hit Enter OK, successfully used password, moving on... Set root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] n Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!
for the first time you have to run above command and configure the root password, enable or disable networking
Connect to the instance and create your first maria DB database
# mysql -u root -p Enter Password:
Create your first MariaDB database
> create database servercomputer; > show databases;
Table creation process
> show tables; Empty set (0.00 sec) MariaDB [emploees]> create table servercomputer (id int(10), name varchar(250), empid varchar(20), number int(12), mail_id varchar(255)); > describe servercomputer;
Insert statement Maria DB
> insert into servercomputer values("1", "Ravi Kumar", "1234", 9800056884, "email@example.com"); Query OK, 1 row affected, 2 warnings (0.00 sec)
Check inserted data from table data
> select * from servercomputer;
> update servercomputer set empid = 9780 where id='1';
where the serial number is 1 employee id will be updated with 9780
Delete table record using below delete statement
> delete from servercomputer where id='1';
How to Create New user in MariaDB and Grant access
> create user ravi@'%' Identified by 'password'; > SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user = 'ravi');
User Ravi has been created successfully and granted access.
Maria DB Installation was successful.