UP | HOME

CentOS7安装MariaDB10与XtraBackup

添加MariaDB软件仓库

$ vi /etc/yum.repos.d/MariaDB.repo
    [mariadb]
    name=MariaDB
    baseurl=http://yum.mariadb.org/10.0/centos7-amd64/
    gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
    gpgcheck=1
    priority=1
$ yum check-update

添加XtraBackup软件仓库

$ vi /etc/yum.repos.d/MariaDB.repo
    [percona]
    name=CentOS $releasever - Percona
    baseurl=http://repo.percona.com/centos/$releasever/os/$basearch/
    gpgkey=https://www.percona.com/downloads/RPM-GPG-KEY-percona
    gpgcheck=1
    priority=2
$ yum check-update

导入MariaDB证书

$ rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

导入Percona证书

$ rpm --import https://www.percona.com/downloads/RPM-GPG-KEY-percona

安装MariaDB

$ yum install MariaDB-server MariaDB-client

安装Percona Xtrabackup

$ yum install percona-xtrabackup

启动MariaDB

$ /etc/init.d/mysql start

开机自动启动MariaDB

$ chkconfig mysql on

或者

$ systemctl enable mariadb.service

初始化安全设置

$ /usr/bin/mysql_secure_installation

允许root远程登录

$ mysql -uroot -p123456
  MariaDB[] > GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
  MariaDB[] > FLUSH PRIVILEGES;

Date: 2019-01-16 Wed 14:27

Author: shixiongfei

Created: 2020-09-05 Sat 14:40

Emacs 27.1 (Org mode 9.3)