Installing MariaDB on Ubuntu

Mariadb is an excellent relational database management system that started as a fork  for mySQL. The reason for the fork was concern over the way that Oracle is taking mysql.
Installing MariaDBin on Ubuntu 16.04 is very easy.
Since it is part of the ubuntu repository, then apt-get install mariadb-server will install mariaDB.


bob@vmUbuntu:~$ sudo apt-get install mariadb-server
[sudo] password for bob: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libaio1 libcgi-fast-perl libcgi-pm-perl libdbd-mysql-perl libdbi-perl
  libencode-locale-perl libfcgi-perl libhtml-parser-perl
  libhtml-tagset-perl libhtml-template-perl libhttp-date-perl
  libhttp-message-perl libio-html-perl liblwp-mediatypes-perl
  libmysqlclient20 libterm-readkey-perl libtimedate-perl liburi-perl
  mariadb-client-10.0 mariadb-client-core-10.0 mariadb-common
  mariadb-server-10.0 mariadb-server-core-10.0 mysql-common
Suggested packages:
  libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl
  libdata-dump-perl libipc-sharedcache-perl libwww-perl mailx
  mariadb-test tinyca
The following NEW packages will be installed:
  libaio1 libcgi-fast-perl libcgi-pm-perl libdbd-mysql-perl libdbi-perl
  libencode-locale-perl libfcgi-perl libhtml-parser-perl
  libhtml-tagset-perl libhtml-template-perl libhttp-date-perl
  libhttp-message-perl libio-html-perl liblwp-mediatypes-perl
  libmysqlclient20 libterm-readkey-perl libtimedate-perl liburi-perl
  mariadb-client-10.0 mariadb-client-core-10.0 mariadb-common
  mariadb-server mariadb-server-10.0 mariadb-server-core-10.0
  mysql-common
0 upgraded, 25 newly installed, 0 to remove and 26 not upgraded.
Need to get 16.3 MB of archives.
After this operation, 143 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Fetched 16.3 MB in 22s (725 kB/s)                                       
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 59246 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.7.13-0ubuntu0.16.04.2_all.deb ...
Unpacking mysql-common (5.7.13-0ubuntu0.16.04.2) ...
Selecting previously unselected package mariadb-common.
Preparing to unpack .../mariadb-common_10.0.25-0ubuntu0.16.04.1_all.deb ...
Unpacking mariadb-common (10.0.25-0ubuntu0.16.04.1) ...
Selecting previously unselected package libdbi-perl.
Preparing to unpack .../libdbi-perl_1.634-1build1_amd64.deb ...
Unpacking libdbi-perl (1.634-1build1) ...
Selecting previously unselected package libmysqlclient20:amd64.
Preparing to unpack .../libmysqlclient20_5.7.13-0ubuntu0.16.04.2_amd64.deb ...
Unpacking libmysqlclient20:amd64 (5.7.13-0ubuntu0.16.04.2) ...
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack .../libdbd-mysql-perl_4.033-1build2_amd64.deb ...
Unpacking libdbd-mysql-perl (4.033-1build2) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../libterm-readkey-perl_2.33-1build1_amd64.deb ...
Unpacking libterm-readkey-perl (2.33-1build1) ...
Selecting previously unselected package libaio1:amd64.
Preparing to unpack .../libaio1_0.3.110-2_amd64.deb ...
Unpacking libaio1:amd64 (0.3.110-2) ...
Selecting previously unselected package mariadb-client-core-10.0.
Preparing to unpack .../mariadb-client-core-10.0_10.0.25-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mariadb-client-core-10.0 (10.0.25-0ubuntu0.16.04.1) ...
Selecting previously unselected package mariadb-client-10.0.
Preparing to unpack .../mariadb-client-10.0_10.0.25-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mariadb-client-10.0 (10.0.25-0ubuntu0.16.04.1) ...
Selecting previously unselected package mariadb-server-core-10.0.
Preparing to unpack .../mariadb-server-core-10.0_10.0.25-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mariadb-server-core-10.0 (10.0.25-0ubuntu0.16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Setting up mysql-common (5.7.13-0ubuntu0.16.04.2) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up mariadb-common (10.0.25-0ubuntu0.16.04.1) ...
update-alternatives: using /etc/mysql/mariadb.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mariadb-server-10.0.
(Reading database ... 59603 files and directories currently installed.)
Preparing to unpack .../mariadb-server-10.0_10.0.25-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mariadb-server-10.0 (10.0.25-0ubuntu0.16.04.1) ...
Selecting previously unselected package libhtml-tagset-perl.
Preparing to unpack .../libhtml-tagset-perl_3.20-2_all.deb ...
Unpacking libhtml-tagset-perl (3.20-2) ...
Selecting previously unselected package liburi-perl.
Preparing to unpack .../liburi-perl_1.71-1_all.deb ...
Unpacking liburi-perl (1.71-1) ...
Selecting previously unselected package libhtml-parser-perl.
Preparing to unpack .../libhtml-parser-perl_3.72-1_amd64.deb ...
Unpacking libhtml-parser-perl (3.72-1) ...
Selecting previously unselected package libcgi-pm-perl.
Preparing to unpack .../libcgi-pm-perl_4.26-1_all.deb ...
Unpacking libcgi-pm-perl (4.26-1) ...
Selecting previously unselected package libfcgi-perl.
Preparing to unpack .../libfcgi-perl_0.77-1build1_amd64.deb ...
Unpacking libfcgi-perl (0.77-1build1) ...
Selecting previously unselected package libcgi-fast-perl.
Preparing to unpack .../libcgi-fast-perl_1%3a2.10-1_all.deb ...
Unpacking libcgi-fast-perl (1:2.10-1) ...
Selecting previously unselected package libencode-locale-perl.
Preparing to unpack .../libencode-locale-perl_1.05-1_all.deb ...
Unpacking libencode-locale-perl (1.05-1) ...
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack .../libhtml-template-perl_2.95-2_all.deb ...
Unpacking libhtml-template-perl (2.95-2) ...
Selecting previously unselected package libtimedate-perl.
Preparing to unpack .../libtimedate-perl_2.3000-2_all.deb ...
Unpacking libtimedate-perl (2.3000-2) ...
Selecting previously unselected package libhttp-date-perl.
Preparing to unpack .../libhttp-date-perl_6.02-1_all.deb ...
Unpacking libhttp-date-perl (6.02-1) ...
Selecting previously unselected package libio-html-perl.
Preparing to unpack .../libio-html-perl_1.001-1_all.deb ...
Unpacking libio-html-perl (1.001-1) ...
Selecting previously unselected package liblwp-mediatypes-perl.
Preparing to unpack .../liblwp-mediatypes-perl_6.02-1_all.deb ...
Unpacking liblwp-mediatypes-perl (6.02-1) ...
Selecting previously unselected package libhttp-message-perl.
Preparing to unpack .../libhttp-message-perl_6.11-1_all.deb ...
Unpacking libhttp-message-perl (6.11-1) ...
Selecting previously unselected package mariadb-server.
Preparing to unpack .../mariadb-server_10.0.25-0ubuntu0.16.04.1_all.deb ...
Unpacking mariadb-server (10.0.25-0ubuntu0.16.04.1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up libdbi-perl (1.634-1build1) ...
Setting up libmysqlclient20:amd64 (5.7.13-0ubuntu0.16.04.2) ...
Setting up libdbd-mysql-perl (4.033-1build2) ...
Setting up libterm-readkey-perl (2.33-1build1) ...
Setting up libaio1:amd64 (0.3.110-2) ...
Setting up mariadb-client-core-10.0 (10.0.25-0ubuntu0.16.04.1) ...
Setting up mariadb-client-10.0 (10.0.25-0ubuntu0.16.04.1) ...
Setting up mariadb-server-core-10.0 (10.0.25-0ubuntu0.16.04.1) ...
Setting up mariadb-server-10.0 (10.0.25-0ubuntu0.16.04.1) ...
Setting up libhtml-tagset-perl (3.20-2) ...
Setting up liburi-perl (1.71-1) ...
Setting up libhtml-parser-perl (3.72-1) ...
Setting up libcgi-pm-perl (4.26-1) ...
Setting up libfcgi-perl (0.77-1build1) ...
Setting up libcgi-fast-perl (1:2.10-1) ...
Setting up libencode-locale-perl (1.05-1) ...
Setting up libhtml-template-perl (2.95-2) ...
Setting up libtimedate-perl (2.3000-2) ...
Setting up libhttp-date-perl (6.02-1) ...
Setting up libio-html-perl (1.001-1) ...
Setting up liblwp-mediatypes-perl (6.02-1) ...
Setting up libhttp-message-perl (6.11-1) ...
Setting up mariadb-server (10.0.25-0ubuntu0.16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...

After the installation completed you need to use sudo to connect as a root user.
You just need to run sudo mysql -u root
And you will see the following message:


bob@vmUbuntu:~$ sudo mysql -u root 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 47
Server version: 10.0.25-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

Now you can start work with mariaDB just like you would work with MySQL.

However it is recommended to improve the security of the database by running:

sudo mysql_secure_installation

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s