Offline rpm install Mariadb

一、https://mirrors.tuna.tsinghua.edu.cn/mariadb/mariadb-10.2.5/yum/centos6-amd64/rpms/

download:

 galera-25.3.19-1.rhel6.el6.x86_64.rpm

 MariaDB-server-10.2.5-1.el6.x86_64-client.rpm

 MariaDB-server-10.2.5-1.el6.x86_64-common.rpm

 MariaDB-server-10.2.5-1.el6.x86_64-compat.rpm

 MariaDB-server-10.2.5-1.el6.x86_64-devel.rpm

 MariaDB-server-10.2.5-1.el6.x86_64-server.rpm

二、yum remove mysql*

三、yum install libaio perl perl-DBI perl-Module-Pluggable perl-Pod-Escapes perl-Pod-Simple perl-libs perl-version

Four: Enter the download directory:

rpm -i MariaDB*

 

 

 

Below is the English version:

Here are the detailed steps for installing MariaDB (version 10.1.21) via RPMs on CentOS 7.

The RPM's needed for the installation are all available on the MariaDB website and are given below:

  • jemalloc-3.6.0-1.el7.x86_64.rpm
  • MariaDB-10.1.21-centos7-x86_64-client.rpm
  • MariaDB-10.1.21-centos7-x86_64-compat.rpm
  • galera-25.3.19-1.rhel7.el7.centos.x86_64.rpm
  • jemalloc-devel-3.6.0-1.el7.x86_64.rpm
  • MariaDB-10.1.21-centos7-x86_64-common.rpm
  • MariaDB-10.1.21-centos7-x86_64-server.rpm

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-x86_64-common.rpm

While installing MariaDB-10.1.21-centos7-x86_64-common.rpm there might be a conflict with older MariaDB packages. we need to remove them and install the original rpm again.

Here is the error message for dependencies:

# rpm -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

Solution: search for this package:

# rpm -qa | grep mariadb-libs
mariadb-libs-5.5.52-1.el7.x86_64

Remove this package:

# rpm -ev --nodeps mariadb-libs-5.5.52-1.el7.x86_64
Preparing packages...
mariadb-libs-1:5.5.52-1.el7.x86_64
  • 5) rpm -ivh MariaDB-10.1.21-centos7-x86_64-common.rpm
  • 6) rpm -ivh MariaDB-10.1.21-centos7-x86_64-compat.rpm
  • 7) rpm -ivh MariaDB-10.1.21-centos7-x86_64-client.rpm
  • 8) rpm -ivh galera-25.3.19-1.rhel7.el7.centos.x86_64.rpm

While installing the Galera package there might be a conflict in installation for a dependency package. Here is the error message:

[root@centos-2 /]# rpm -ivh galera-25.3.19-1.rhel7.el7.centos.x86_64.rpm 
error: Failed dependencies:
	libboost_program_options.so.1.53.0()(64bit) is needed by galera-25.3.19-1.rhel7.el7.centos.x86_64

The dependencies for Galera package is: libboost_program_options.so.1.53.0

Solution:

yum install boost-devel.x86_64

Another warning message while installing Galera package is as shown below:

warning: galera-25.3.19-1.rhel7.el7.centos.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY 

The solution for this is to import the key:

#rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB
  • 9) rpm -ivh MariaDB-10.1.21-centos7-x86_64-server.rpm

After step 9, the installation will be completed. The last step will be to run mysql_secure_installation to secure the production server by dis allowing remote login for root, creating root password and removing the test database.

  • 10) mysql_secure_installation
https://mariadb.com/kb/en/mariadb/mariadb-installation-version-10121-via-rpms-on-centos-7/

 

ps:
Mysql安装完后,需要设置服务端字符集:
修改/etc/my.cnf.d/server.cnf
 
[mysqld]
 
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
#skip-networking
#bind-address = <some ip-address>
 
修改/etc/my.cnf.d/mysql-clients.cnf

 

[mysql]
default-character-set=utf8

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326350591&siteId=291194637