CentOS 7.6 install MariaDB 10.4.8 super detailed tutorial

The MariaDB database management system is a branch of MySQL and is mainly maintained by the open source community. The purpose of using GPL license MariaDB is to be fully compatible with MySQL, including APIs and command lines, so that it can easily become a substitute for MySQL.

CentOS 7.6 install MariaDB 10.4.8

  1. Download the installation package and dependencies in turn
[root@localhost software]# cd MariaDB-10.4.8.stable-CentOS7.x/
[root@localhost MariaDB-10.4.8.stable-CentOS7.x]# pwd
/home/software/MariaDB-10.4.8.stable-CentOS7.x
[root@localhost MariaDB-10.4.8.stable-CentOS7.x]# ls
galera-4-26.4.2-1.rhel7.el7.centos.x86_64.rpm  MariaDB-client-10.4.8-1.el7.centos.x86_64.rpm
jemalloc-3.6.0-1.el7.x86_64.rpm                MariaDB-common-10.4.8-1.el7.centos.x86_64.rpm
jemalloc-devel-3.6.0-1.el7.x86_64.rpm          MariaDB-compat-10.4.8-1.el7.centos.x86_64.rpm
libaio-0.3.107-10.el6.x86_64.rpm               MariaDB-server-10.4.8-1.el7.centos.x86_64.rpm
  1. Install dependent environments in order
yum install rsync nmap lsof perl-DBI nc
rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm
rpm -ivh jemalloc-devel-3.6.0-1.el7.x86_64.rpm
  1. Uninstall conflicting libraries
rpm -qa | grep mariadb-libs
rpm -ev --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
rpm -qa | grep mariadb-libs
  1. Install bost-devel dependencies
yum install boost-devel.x86_64
  1. Import MariaDB key
rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB
  1. Install galera environment
rpm -ivh galera-4-26.4.2-1.rhel7.el7.centos.x86_64.rpm
  1. Install libaio
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm
rpm -ivh libaio-0.3.107-10.el6.x86_64.rpm 
  1. Install the core package
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-client-10.4.8-1.el7.centos.x86_64.rpm MariaDB-server-10.4.8-1.el7.centos.x86_64.rpm
  1. Restart MySQL service
service mysql start
  1. After the service is started successfully, perform security configuration
mysql_secure_installation
1. 输入当前密码,初次安装后是没有密码的,直接回车
2.询问是否使用`unix_socket`进行身份验证:n
3.为root设置密码:y
4.输入root的新密码:root
5.确认输入root的新密码:root
6.是否移除匿名用户,这个随意,建议删除:y
7.拒绝用户远程登录,这个建议开启:n
8.删除test库,可以保留:n
9.重新加载权限表:y
  1. Set up remote connection (enter console settings)
grant all privileges on *.* to 'root'@'%' identified by 'root密码'; 
flush privileges;

Reference documents

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

Guess you like

Origin blog.csdn.net/LIZHONGPING00/article/details/113922256