Installing MariaDB
A large number of services use to access to the database - web applications, company websites, as well as mail services and various accounting systems. Today we will consider installing one of the most popular DBMSs - MariaDB.
In this article we will not consider how to install and configure a LAMP server. It should be noted that the MySQL server in the repositories has been replaced by MariaDB due to the openness of the code and the active development of the project itself.
We add the repository since the system will install the version of MariaDB 5.5. For each OS, we consider this moment separately. If this suits you, then you can skip this step. If you still decide to do this, then open the page on the official website with information about repositories and their settings.
Ubuntu
Before installing, we update the data on repositories and package indices:
We update packages and system components:
We reboot the system, sometimes it is required:
Check the version of the MariaDB-server package in the repository:
For Ubuntu 16.04 the answer is as follows:
For Ubuntu 18.04:
Add information about the repository with version 10.3. Important: each version of Ubuntu has its repositories.
For Ubuntu 16.04, we execute the following commands in turn:
For Ubuntu 18.04:
Update the contents of the repositories and complete the installation:
Regardless of the version of Ubuntu, the installer will require you to enter the root password and confirm it:
CentOS
We update system components, and at the same time data on repositories
Add repository for stable version 10.3. To do this, go to the directory with the repository files and create a file:
Data from the official site is added to the file by any editor:
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
Install the package:
The yum program will collect all the necessary data for the installation and will wait for the user:
We answer the question “y” and press Enter. The number of packages you can install may be different.
КThe command should be re-run if the following error occurs:
MariaDB-compat-10.3.14-1.el7.centos.x86_64: [Errno 256] No more mirrors to try.
MariaDB-client-10.3.14-1.el7.centos.x86_64: [Errno 256] No more mirrors to try.
MariaDB-common-10.3.14-1.el7.centos.x86_64: [Errno 256] No more mirrors to try.
After installation, you should start the server:
Setup
Most programs are installed with default settings. Regardless of the distribution, we recommend that you optimize your security settings.
Yes, it’s “mysql” because the MariaDB project has "leaked" from MySQL.
At the very beginning, the program will ask for the password for the root user. If the password has not been set, then press Enter. Most questions can be answered with “y”. Questions and translation are listed below:
- Change the root password? [Y/n]
- Remove anonymous users? [Y/n]
- Disallow root login remotely? [Y/n]
- Remove test database and access to it? [Y/n]
- Reload privilege tables now? [Y/n]
Check server status
Sometimes it may be necessary to check the status of the server. This operation can be performed with the command:
It should be noted that if the server is not running, then it must be started in manual mode with the command:
Testing the connection to the DBMS
Connection to the DBMS is performed by the following command:
If this is the first connection and no other users have been added, you should connect from the root user:
Then enter the root password; if no password has been set, press Enter.
Exiting the shell by the command: