1. 程式人生 > >CentOS7.3編譯安裝MariaDB10.2.12

CentOS7.3編譯安裝MariaDB10.2.12

創建 open sta mysql lin ack cli tex 最小化

在CentOS7.3編譯安裝MariaDB10.2.12詳細教程

1. 刪除CentOS7.3默認數據庫配置文件

  • 查看默認數據庫配置文件

[root@localhost ~]# find -H /etc/ | grep my.c
/etc/pki/tls/certs/make-dummy-cert
/etc/pki/tls/certs/renew-dummy-cert
/etc/my.cnf.d
/etc/my.cnf.d/mysql-clients.cnf
/etc/my.cnf
  • 刪除默認數據庫配置文件

[root@localhost ~]# rm -rf /etc/my.cnf /etc/my.cnf.d/
  • 再次查看默認數據庫配置文件

[root@localhost ~]# find -H /etc/ | grep my.c
/etc/pki/tls/certs/make-dummy-cert
/etc/pki/tls/certs/renew-dummy-cert

到目前為止, 系統最小化安裝自帶的數據庫配置文件已經刪除幹凈了!

2. 卸載系統自帶mariadb-libs

  • 查詢

[root@localhost ~]# rpm -qa|grep mariadb-libs
mariadb-libs-5.5.52-1.el7.x86_64
  • 卸載

[root@localhost ~]# rpm -e mariadb-libs-5.5.52-1.el7.x86_64 --nodeps

安裝相關包

[root@localhost ~]# yum -y install libaio 
[root@localhost ~]# yum -y install libaio-devel 
[root@localhost ~]# yum -y install bison 
[root@localhost ~]# yum -y install bison-devel 
[root@localhost ~]# yum -y install zlib-devel 
[root@localhost ~]# yum -y install openssl
[root@localhost ~]# yum -y install openssl-devel 
[root@localhost ~]# yum -y install ncurses 
[root@localhost ~]# yum -y install ncurses-devel
[root@localhost ~]# yum -y install libcurl-devel
[root@localhost ~]# yum -y install libarchive-devel 
[root@localhost ~]# yum -y install boost 
[root@localhost ~]# yum -y install boost-devel 
[root@localhost ~]# yum -y install wget
[root@localhost ~]# yum -y install gcc 
[root@localhost ~]# yum -y install gcc-c++
[root@localhost ~]# yum -y install make
[root@localhost ~]# yum -y install cmake
[root@localhost ~]# yum -y install perl
[root@localhost ~]# yum -y install kernel-headers
[root@localhost ~]# yum -y install kernel-devel 
[root@localhost ~]# yum -y install pcre-devel

如果yum在某些環境下(內網.不能連接外網的情況)可以在網易的開源鏡像搜索下載對應rpm包進行安裝 網易開源鏡像地址:

http://mirrors.163.com/centos/7/os/x86_64/Packages/

rpm -ivh your-package.rpm                                         ---安裝rpm包
rpm -Uvh your-package.rpm                                         ---升級rpm包
rpm -q package-name                                               ---查詢包是否被安裝 
rpm -e  package-name --nodeps                                     ---卸載某個包 不檢查依賴

自動解決依賴關系

yum localinstall xxx.rpm

3. 創建家目錄存放軟件包目錄

這裏目錄名字可以隨意

[root@localhost ~]# mkdir soft
[root@localhost ~]# cd soft

4. MariaDB官網復制源碼包鏈接地址並下載解壓

  • 下載

[root@localhost soft]# wget https://downloads.mariadb.org/interstitial/mariadb-10.2.12/source/mariadb-10.2.12.tar.gz
    • 解壓

    tar -zxvf mariadb-10.2.12.tar.gz


    CentOS7.3編譯安裝MariaDB10.2.12