av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

CentOS7下MariaDB5.5升級(jí)到MariaDB10.2

一次centos 7下升級(jí)MariaDB過(guò)程,在此記錄下。

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

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

升級(jí)主要步驟:

備份原數(shù)據(jù)庫(kù) ---》卸載mariadb ---》添加mariadb國(guó)內(nèi)yum源 ---》安裝mariadb---》初始化數(shù)據(jù)庫(kù)---》導(dǎo)入數(shù)據(jù)。

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

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

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

2. 卸載mariadb

由于是在同一臺(tái)服務(wù)器進(jìn)行安裝新的Mariadb10.2,所以我們需要將老的版本卸載。

卸載mariadb:

yum remove mariadb

刪除配置文件:

rm -f /etc/my.cnf

刪除數(shù)據(jù)目錄:

rm -rf /var/lib/mysql/

3. 添加mariadb10.2的國(guó)內(nèi)yum源

之前我添加的是國(guó)外的源,安裝很耗時(shí),所以我找到國(guó)內(nèi)yum源,通過(guò)這個(gè)源安裝較快。

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

添加以下內(nèi)容:

[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ù)據(jù)

yum clean all

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

yum makecache all

官方y(tǒng)um源(國(guó)內(nèi)安裝較慢)

# 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源網(wǎng)址:https://downloads.mariadb.org/mariadb/repositories/#mirror=tuna

4. 安裝mariadb10.2

yum install MariaDB-server MariaDB-client -y

啟動(dòng)并添加開機(jī)自啟:

systemctl start mariadb.service
systemctl enable mariadb.service

5. mariadb的初始化

/usr/bin/mysql_secure_installation

一般建議按以下進(jìn)行配置:

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. 導(dǎo)入數(shù)據(jù)到新版本mariadb

方法一:

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

source /root/backup/java_api.sql

方法二:

在命令行直接導(dǎo)入

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

以上就是整個(gè)版本升級(jí)的過(guò)程了。


分享文章:CentOS7下MariaDB5.5升級(jí)到MariaDB10.2
標(biāo)題網(wǎng)址:http://uogjgqi.cn/article/cocpphd.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們?cè)谖⑿派?4小時(shí)期待你的聲音

解答本文疑問(wèn)/技術(shù)咨詢/運(yùn)營(yíng)咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流