What is a mariaDB?

  • Online installation (painfully slow)
  • RPM Offline installation (centos7.x)

Online installation

  1. Open the official websitemariadb.org/



  2. Click on theDownload, skip to the next page



  3. Continue to clickDownloadGo to the next page



  4. Click the red box [link] (https://downloads.mariadb.org/mariadb/repositories/#mirror=23Media), into the page



  5. Select the database version to install based on your server type/version. Follow the preceding steps to install it online.

Offline installation

  1. Click in Figure 4baseurl



  2. Click on therpms, you can see a bunch of RPM packages, don’t worry, continue to see the next step



  3. Open MariaDB org –> Learn –> [MariaDB Knowledge Base] –> MariaDB Server –>

Getting, Installing, and Upgrading MariaDB –> MariaDB Binary Packages –> Installing MariaDB RPM Files –> MariaDB Installation (Version 10.1.21) via RPMs on CentOS 7

After clicking the final URL, you can see the interface as shown below:



Could have provided a final URL, provide step by step click button link, is to facilitate everyone to learn the route ideas, rather than just take the results.

  1. Remember the pile of RPM packages we saw earlier in step 2? Download the package from the box in step 3. Of course, the version of the document is a little behind, but we just need to search for prefix names, such as searchclient:



    Let’s just download the latest version.

    Next, we will enter the formal steps.

    It is shown in Figure 7Step by step installation:

Step by step installation:

– 1) First install all of the dependencies needed. Its easy to do this via YUM packages: yum install rsync nmap lsof perl-DBI nc

– 2) RPM -ivh jemalloc-3.6.0-1.el7.x86_64. RPM

-3) RPM -ivh jemalloc-devel-3.6.0-1.el7.x86_64. RPM

– 4) RPM -ivh mariadb-10.1.21-centos7-x8664-common. RPM Mariadb-10.1.21-centos7-x8664-compat MariaDB 10.1.21 – centos7 – x8664 – client. RPM galera 25.3.19-1. Rhel7. El7. Centos. X8664. RPM MariaDB 10.1.21 – centos7 – x86_64 – server. The RPM

Follow the steps to get started:

  1. To install dependency information, run the following command:
   [root@iZ2ze7s2v0b78922wia32rZ software]#  yum install rsync nmap lsof perl-DBI ncCopy the code

  1. Install the version we downloaded earlierJemalloc 3.6.0-1. El7. X86_64. RPM
   [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm Copy the code

  1. The installationJemalloc - devel - 3.6.0-1. El7. X86_64. RPM
   [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ivh jemalloc-devel-3.6.0-1.el7.x86_64.rpmCopy the code

  1. Install the remaining MariADB related packages, be sure to pay attention to the order.common > compat > client > galera > server
[root@iZ2ze7s2v0b78922wia32rZ mariadb]# RPM -ivh mariadb-common-10.4.8-1.el7.centos.x86_64. RPM MariaDB - compat - 10.4.8-1. El7. Centos. X86_64. RPM MariaDB - the client - 10.4.8-1. El7. Centos. X86_64. RPM Galera - 4-26.4.3-1. Rhel7. El7. Centos. X86_64. RPM MariaDB server - 10.4.8-1. El7. Centos. X86_64. RPM warning: Mariadb-common-10.4.8-1.el7.centos.x86_64. RPM: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY error: Failed dependencies: Mariadb-libs < 1:10.1.0 conflicts with Mariadb-compat-10.4.8-1.el7.centos. X86_64 MariadB-libs is obsoleted by Mariadb-compat-10.4.8-1.el7.centos.x86_64 libaio.so.1()(64bit) is needed by Mariadb-client-10.4.8-1.el7.centos.x86_64 Libaio. So1 (libaio_0.1)(64bit) is needed by MariadB-client-10.4.8-1.el7.centos.x86_64 libaio. So1 (libaio_0.4)(64bit) IS Needed by Mariadb-client-10.4.8-1.el7.centos.x86_64 libboost_program_options.so.1.53.0()(64bit) is needed by mariadb-client-10.4.8-1.el7.centos.x86_64 libboost_program_options.so Galera-4-26.4.3-1.rhel7.el7.centos.x86_64 libaio.so.1()(64bit) is needed by Mariadb-server-10.4.8-1.el7.centos.x86_64 Libaio. So1 (libaio_0.1)(64bit) is needed by MariadB-server-10.4.8-1.el7.centos.x86_64 libaio. So1 (libaio_0.4)(64bit) IS Men by MariaDB server - 10.4.8-1. El7. Centos. X86_64Copy the code

Here is the error message for dependencies: Step by Step installation

`

The RPM – the ivh MariaDB 10.1.21 – centos7 – x86_64 – common. RPM

Warning: MariadB-10.1.21-centos7-x86_64-common. RPM: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY

error: Failed dependencies:

Mariadb-libs < 1:10.1.21-1.el7.centos conflicts with mariadb-common-10.1.21-1.el7.centos.x86_64

`

Is it similar to our mistakes? It can be solved according to the official solution.

There were several subsequent mistakes, which were handled step by step according to the official solution, as follows:

[root @ iZ2ze7s2v0b78922wia32rZ mariadb] # RPM - qa | grep mariadb - libs mariadb - libs - 5.5.60-1. El7_5. X86_64 [root@iZ2ze7s2v0b78922wia32rZ mariadb]# RPM -ev --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64 Preparing packages... Mariadb - libs - 1:5. 5.60 1. El7_5. X86_64 [root @ iZ2ze7s2v0b78922wia32rZ mariadb] # RPM - qa | grep mariadb - libs [root@iZ2ze7s2v0b78922wia32rZ mariadb]# yum install boost-devel.x86_64 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ... Is this ok [y/d/N]: y ... Complete! [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDBCopy the code

Then go back to step 4 of the installation:

[root@iZ2ze7s2v0b78922wia32rZ mariadb]# RPM -ivh mariadb-common-10.4.8-1.el7.centos.x86_64. RPM MariaDB - compat - 10.4.8-1. El7. Centos. X86_64. RPM MariaDB - the client - 10.4.8-1. El7. Centos. X86_64. RPM RPM mariadb-server-10.4.8-1.el7.centos.x86_64. RPM Error: Failed dependencies: Libaio. So1 ()(64bit) is needed by Mariadb-client-10.4.8-1.el7.centos.x86_64 libaio. So1 (64bit) is needed by mariadb-client-10.4.8-1.el7.centos.x86_64 libaio Mariadb-client-10.4.8-1.el7.centos.x86_64 libaio.so.1(libaio_0.4)(64bit) is needed by Mariadb-client-10.4.8-1.el7.centos.x86_64 libaio.so.1()(64bit) is needed by Mariadb-server-10.4.8-1.el7.centos.x86_64 Libaio. So1 (libaio_0.1)(64bit) is needed by MariadB-server-10.4.8-1.el7.centos.x86_64 libaio. So1 (libaio_0.4)(64bit) IS Men by MariaDB server - 10.4.8-1. El7. Centos. X86_64Copy the code

Discovery or error??

This is a new issue introduced in 10.4.8, which requires downloading a dependency package libaio:

[root@iZ2ze7s2v0b78922wia32rZ mariadb]# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm - 10:52:26-2019-11-28 http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpmCopy the code

After the download is successful, install the dependencies currently downloaded:

   [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ivh libaio-0.3.107-10.el6.x86_64.rpmCopy the code

Then repeat Step 4 again:

[root@iZ2ze7s2v0b78922wia32rZ mariadb]# RPM -ivh mariadb-common-10.4.8-1.el7.centos.x86_64. RPM MariaDB - compat - 10.4.8-1. El7. Centos. X86_64. RPM MariaDB - the client - 10.4.8-1. El7. Centos. X86_64. RPM Galera - 4-26.4.3-1. Rhel7. El7. Centos. X86_64. RPM MariaDB server - 10.4.8-1. El7. Centos. X86_64. RPM Preparing... ################################# [100%] Updating / installing... 1: MariaDB - compat - 10.4.8-1. El7. Cento# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [20%] 2: MariaDB - common - 10.4.8-1. El7. Cento# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [40%] 3: MariaDB - the client - 10.4.8-1. El7. Cento# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [60%] 4: galera - 4-26.4.3-1. Rhel7. El7. Cento# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [80%] 5: MariaDB server - 10.4.8-1. El7. Cento# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [100%] Two all - privilege accounts were created. The One  is root@localhost, it has no password, but you need to be system 'root' user to connect. Use, for example, sudo mysql The second is mysql@localhost, it has no password either, but you need to be the system 'mysql' user to connect. After connecting you can set the password, if you would need to be able to connect as any of these users with a password and without sudo See the MariaDB Knowledgebase at http://mariadb.com/kb or the MySQL manual for more instructions. Please report any problems at http://mariadb.org/jira The latest information about MariaDB is available at http://mariadb.org/. You can find additional information about the MySQL part at: http://dev.mysql.com Consider joining MariaDB's strong and vibrant community: https://mariadb.org/get-involved/Copy the code

Finally a successful installation…

Next, the final step is to configure the database:

MariaDB is a new database created by mysql. MariaDB is the same service as mysql. [root@iZ2ze7s2v0b78922wia32rZ ~]# service mysql start [root@iZ2ze7s2v0b78922wia32rZ ~]# Mysql_secure_installation # Enter current password for root (Enter for none): Switch to unix_socket authentication [Y/n] n # step 2: To Change the password, select Change the root password? [Y/n] Y # step 3: Remove anonymous users. [Y/n] Y # Step 4: Whether to allow root login remotely based on personal requirements, because I am testing server select allow root login remotely? [Y/n] Y # step 5: Remove test database and access to it? 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!Copy the code

test

Logging in to the database:

[root@iZ2ze7s2v0b78922wia32rZ ~]# mysql -u root -pCopy the code

Example Change the remote connection permission of root

MariaDB [(none)]> grant all privileges on *.* to 'root'@'%' identified by 'your password';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)Copy the code

Client remote connection

Running life garden | | blog segmentfault | spring4all | CSDN Denver | | OSChina book | | Jane headlines | zhihu | 51 cto