日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網營銷解決方案
CentOS7下MariaDB5.5升級到MariaDB10.2

一次centos 7下升級MariaDB過程,在此記錄下。

創(chuàng)新互聯(lián)公司專注于企業(yè)成都營銷網站建設、網站重做改版、漳縣網站定制設計、自適應品牌網站建設、H5場景定制、成都商城網站開發(fā)、集團公司官網建設、外貿營銷網站建設、高端網站制作、響應式網頁設計等建站業(yè)務,價格優(yōu)惠性價比高,為漳縣等各大城市提供網站開發(fā)制作服務。

原因:新的項目需要新的數(shù)據庫版本支持。

升級主要步驟:

備份原數(shù)據庫 ---》卸載mariadb ---》添加mariadb國內yum源 ---》安裝mariadb---》初始化數(shù)據庫---》導入數(shù)據。

1. 備份原數(shù)據庫

  由于是對測試環(huán)境的數(shù)據庫進行升級,數(shù)據量不多,我直接導出需要遷移的數(shù)據庫的數(shù)據到sql文件里。

mysqldump  -uroot  -p  --database database_name >name.sql

2. 卸載mariadb

由于是在同一臺服務器進行安裝新的Mariadb10.2,所以我們需要將老的版本卸載。

卸載mariadb:

yum remove mariadb

刪除配置文件:

rm -f /etc/my.cnf

刪除數(shù)據目錄:

rm -rf /var/lib/mysql/

3. 添加mariadb10.2的國內yum源

之前我添加的是國外的源,安裝很耗時,所以我找到國內yum源,通過這個源安裝較快。

vim  /etc/yum.repos.d/Mariadb.repo

添加以下內容:

[mariadb]
name = MariaDB
baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.2/centos7-amd64
gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1

清除yum源緩存數(shù)據

yum clean all

生成新的yum源數(shù)據緩存

yum makecache all

官方y(tǒng)um源(國內安裝較慢)

# MariaDB 10.2 CentOS repository list - created 2018-06-06 03:42 UTC

# http://downloads.mariadb.org/mariadb/repositories/

[mariadb]

name = MariaDB

baseurl = http://yum.mariadb.org/10.2/centos7-amd64

gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

gpgcheck=1

官方不同系統(tǒng)yum源網址:https://downloads.mariadb.org/mariadb/repositories/#mirror=tuna

4. 安裝mariadb10.2

yum install MariaDB-server MariaDB-client -y

啟動并添加開機自啟:

systemctl start mariadb.service
systemctl enable mariadb.service

5. mariadb的初始化

/usr/bin/mysql_secure_installation

一般建議按以下進行配置:

Enter current password for root (enter for none): Just press the Enter button
Set root password? [Y/n]: Y
New password: your-MariaDB-root-password
Re-enter new password: your-MariaDB-root-password
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: n
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y

6. 導入數(shù)據到新版本mariadb

方法一:

登陸mysql后用source命令:(后面跟的是我們備份的sql文件的路徑)

source /root/backup/java_api.sql

方法二:

在命令行直接導入

mysql -uroot -p >/root/backup/java_api.sql

以上就是整個版本升級的過程了。


當前文章:CentOS7下MariaDB5.5升級到MariaDB10.2
本文鏈接:http://m.5511xx.com/article/cocpphd.html