How to install MariaDB 10.1 and Run Various MariaDB Queries in Debian
To install MariaDB 10.1 and Run Various MariaDB Queries in Debian
MariaDB is a drop-in replacement for MySQL. It is an opensource Relational Database Management System (RDBMS) which supports database access. It is a logical choice for database professionals looking for a robust, scalable, and reliable SQL server. Installation of MariaDB 10.1 is explained in this article.
Features
- Data on disk is encrypted.
- Optimistic parallel replication
- InnoDB/XtraDB page compression for FusionIO
- Built-in galera cluster support which is a true multi-master replication solution
Install the software-properties-common package before installing mariadb repositories.
root@linuxhelp:~# apt-get install software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libkeybinder0 python-keybinder
.
.
.
Setting up software-properties-common (0.92.25debian1) ...
Processing triggers for systemd (215-17+deb8u3) ...
Processing triggers for dbus (1.8.20-0+deb8u1) ...
Now register and import the GPG key.
root@linuxhelp:~# apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.FIfOKbhu2g --no-auto-check-trustdb --trust-model always --primary-keyring /etc/ap
.
.
.
gpg: Total number processed: 1
gpg: imported: 1
Add the MariaDB repository into the Debian machine.
root@linuxhelp:~# add-apt-repository ' deb [arch=64,i386] http://mirrors.opencas.cn/mariadb/repo/10.1/debain ' $(lsb_release -cs)' main'
After adding the repository, update your Debian machine.
root@linuxhelp:~# apt-get update
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Get:2 http://ftp.debian.org jessie-updates InRelease [142 kB]
Ign http://ftp.de.debian.org wheezy InRelease
.
.
.
Fetched 41.3 MB in 2min 42s (254 kB/s)
Reading package lists... Done
Now install the MariaDB package by using the following command.
root@linuxhelp:~# apt-get install mariadb-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
.
.
.
Processing triggers for libc-bin (2.19-18+deb8u2) ...
Processing triggers for menu (2.1.47) ...
Processing triggers for systemd (215-17+deb8u3) ...
Enter the new password for the root user.
MariaDB 10.1
Click yes to migrate to MariaDB.
ok
Login to MariaDB with root password
root@linuxhelp:~#mysql &ndash u root &ndash p
Enter Password:
login
To List the database available in your MariaDB
MariaDb=B[(none)]> show databases
database
To Use the database
MariaDB [(none)]> use mysql
use db
To List the tables of mariadb
MariaDB [mysql]> show tables
tables
To Use the tables
MariaDB [mysql]> describe user
describe
To Create mariadb user
MariaDB [(none)]> create user ' user 1' identified by ' user@123'
createuser
To Login with created user
root@linuxhelp:~# mysql -u user1 -p
loginuser
To view the grant details
MariaDB [(none)]> show grants
grant
To view the status of mariadb
MariaDB [(none)]> show status
status
To view the process list of mariadb
MariaDB [(none)]> show processlist
processs
Comments ( 0 )
No comments available