MariaDB
Installing
MariaDB is a branch of mySQL that was developed by some of original mySQL developers. by the time of writing this documentation the current version is 10.2 which is we need a version >= than that because some new geographical improved functions in latest release were used in app. Use the installation guide provided for your distro in below. if you use another distro you might need to search for your own distro's installation guide.
CentOS7
Start by adding the MariaDB YUM repository file MariaDB.repo
for CentOS systems.
nano /etc/yum.repos.d/MariaDB.repo
Now add the following lines to this file and save using Ctrl+X
as shown in bottom of terminal.
1 2 3 4 5 | [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 |
Now do the installation using official package manager:
yum install MariaDB-server MariaDB-client -y
Then you should enter these two commands to have the service up and running forever:
1 2 | systemctl start mariadb
systemctl enable mariadb
|
Ubuntu
Enter following commands one by one.
1 2 3 4 5 6 7 | sudo apt-get -y install software-properties-common sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.utexas.edu/mariadb/repo/10.2/ubuntu xenial main' sudo apt-get update sudo apt-get install mariadb-server mariadb-client systemctl start mariadb systemctl enable mariadb |
Finally
After you have installed MariaDB you can go through mysql installation wizard to make it more secure and set a password for your database. remember doing this is important because without this your users info could be accessed easily by anyone. Enter following command and wizard will be started:
mysql_secure_installation