CentOS7上MariaDB5.5升10.3
准备拿这台破机器干点别的事,发现默认源的mariadb有点老,有些命令不支持,于是打算升下级,查了下,从5.5升到10.3虽然理论上没什么问题,但是还是建议采取先备份数据库再卸载旧的,安装新的这种方式,毕竟跨度过大。然而我这种懒癌晚期的人,呵,不要说了,就是刚(误,正式环境请千万别学我)。
- https://linuxize.com/post/install-mariadb-on-centos-7/
- https://www.zerostopbits.com/how-to-upgrade-mariadb-5-5-to-mariadb-10-3-on-centos-7-5-1804/
- https://dba.stackexchange.com/questions/209675/can-upgrade-from-mariadb-5-5-to-mariadb-10-3-directly
首先添加10.3的yum源:
vim /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.3 CentOS repository list - created 2018-05-25 19:02 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
然后直接yum update
(是不是有点太粗暴了...)
更新的详细内容如下:
[root@vultr yum.repos.d]# touch MariaDB.repo
[root@vultr yum.repos.d]# vim MariaDB.repo
[root@vultr yum.repos.d]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* epel: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
mariadb | 2.9 kB 00:00:00
mariadb/primary_db | 48 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-client.x86_64 0:10.3.13-1.el7.centos will be obsoleting
--> Processing Dependency: MariaDB-common for package: MariaDB-client-10.3.13-1.el7.centos.x86_64
---> Package MariaDB-compat.x86_64 0:10.3.13-1.el7.centos will be obsoleting
---> Package MariaDB-server.x86_64 0:10.3.13-1.el7.centos will be obsoleting
--> Processing Dependency: galera for package: MariaDB-server-10.3.13-1.el7.centos.x86_64
--> Processing Dependency: lsof for package: MariaDB-server-10.3.13-1.el7.centos.x86_64
---> Package mariadb.x86_64 1:5.5.60-1.el7_5 will be obsoleted
---> Package mariadb-libs.x86_64 1:5.5.60-1.el7_5 will be obsoleted
---> Package mariadb-server.x86_64 1:5.5.60-1.el7_5 will be obsoleted
--> Running transaction check
---> Package MariaDB-common.x86_64 0:10.3.13-1.el7.centos will be installed
---> Package galera.x86_64 0:25.3.25-1.rhel7.el7.centos will be installed
--> Processing Dependency: libboost_program_options.so.1.53.0()(64bit) for package: galera-25.3.25-1.rhel7.el7.centos.x86_64
---> Package lsof.x86_64 0:4.87-6.el7 will be installed
--> Running transaction check
---> Package boost-program-options.x86_64 0:1.53.0-27.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================================================================================
Installing:
MariaDB-client x86_64 10.3.13-1.el7.centos mariadb 53 M
replacing mariadb.x86_64 1:5.5.60-1.el7_5
MariaDB-compat x86_64 10.3.13-1.el7.centos mariadb 2.8 M
replacing mariadb-libs.x86_64 1:5.5.60-1.el7_5
MariaDB-server x86_64 10.3.13-1.el7.centos mariadb 123 M
replacing mariadb-server.x86_64 1:5.5.60-1.el7_5
Installing for dependencies:
MariaDB-common x86_64 10.3.13-1.el7.centos mariadb 167 k
boost-program-options x86_64 1.53.0-27.el7 base 156 k
galera x86_64 25.3.25-1.rhel7.el7.centos mariadb 8.1 M
lsof x86_64 4.87-6.el7 base 331 k
Transaction Summary
=====================================================================================================================================================================================================================================================================
Install 3 Packages (+4 Dependent packages)
Total download size: 188 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/mariadb/packages/MariaDB-10.3.13-centos73-x86_64-common.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY ] 153 kB/s | 148 kB 00:20:56 ETA
Public key for MariaDB-10.3.13-centos73-x86_64-common.rpm is not installed
(1/7): MariaDB-10.3.13-centos73-x86_64-common.rpm | 167 kB 00:00:01
(2/7): MariaDB-10.3.13-centos73-x86_64-compat.rpm | 2.8 MB 00:00:02
(3/7): boost-program-options-1.53.0-27.el7.x86_64.rpm | 156 kB 00:00:00
(4/7): MariaDB-10.3.13-centos73-x86_64-client.rpm | 53 MB 00:00:09
(5/7): lsof-4.87-6.el7.x86_64.rpm | 331 kB 00:00:00
(6/7): galera-25.3.25-1.rhel7.el7.centos.x86_64.rpm | 8.1 MB 00:00:03
(7/7): MariaDB-10.3.13-centos73-x86_64-server.rpm | 123 MB 00:03:22
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 932 kB/s | 188 MB 00:03:26
Retrieving key from https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Importing GPG key 0x1BB943DB:
Userid : "MariaDB Package Signing Key <package-signing-key@mariadb.org>"
Fingerprint: 1993 69e5 404b d5fc 7d2f e43b cbcb 082a 1bb9 43db
From : https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : MariaDB-common-10.3.13-1.el7.centos.x86_64 1/10
Installing : MariaDB-compat-10.3.13-1.el7.centos.x86_64 2/10
Installing : MariaDB-client-10.3.13-1.el7.centos.x86_64 3/10
Installing : boost-program-options-1.53.0-27.el7.x86_64 4/10
Installing : galera-25.3.25-1.rhel7.el7.centos.x86_64 5/10
Installing : lsof-4.87-6.el7.x86_64 6/10
Installing : MariaDB-server-10.3.13-1.el7.centos.x86_64 7/10
Failed to resolve typeattributeset statement at /etc/selinux/targeted/tmp/modules/400/mariadb/cil:1
/usr/sbin/semodule: Failed!
Erasing : 1:mariadb-server-5.5.60-1.el7_5.x86_64 8/10
warning: /var/log/mariadb/mariadb.log saved as /var/log/mariadb/mariadb.log.rpmsave
Erasing : 1:mariadb-5.5.60-1.el7_5.x86_64 9/10
Erasing : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 10/10
Verifying : galera-25.3.25-1.rhel7.el7.centos.x86_64 1/10
Verifying : MariaDB-compat-10.3.13-1.el7.centos.x86_64 2/10
Verifying : MariaDB-client-10.3.13-1.el7.centos.x86_64 3/10
Verifying : lsof-4.87-6.el7.x86_64 4/10
Verifying : boost-program-options-1.53.0-27.el7.x86_64 5/10
Verifying : MariaDB-server-10.3.13-1.el7.centos.x86_64 6/10
Verifying : MariaDB-common-10.3.13-1.el7.centos.x86_64 7/10
Verifying : 1:mariadb-server-5.5.60-1.el7_5.x86_64 8/10
Verifying : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 9/10
Verifying : 1:mariadb-5.5.60-1.el7_5.x86_64 10/10
Installed:
MariaDB-client.x86_64 0:10.3.13-1.el7.centos MariaDB-compat.x86_64 0:10.3.13-1.el7.centos MariaDB-server.x86_64 0:10.3.13-1.el7.centos
Dependency Installed:
MariaDB-common.x86_64 0:10.3.13-1.el7.centos boost-program-options.x86_64 0:1.53.0-27.el7 galera.x86_64 0:25.3.25-1.rhel7.el7.centos lsof.x86_64 0:4.87-6.el7
Replaced:
mariadb.x86_64 1:5.5.60-1.el7_5 mariadb-libs.x86_64 1:5.5.60-1.el7_5 mariadb-server.x86_64 1:5.5.60-1.el7_5
Complete!
嗯,更新成功,舒服~~!
打开博客看下:
这特么就很尴尬了。
搜了两篇文章,不想看,感觉机器有点卡,先重启下吧,重启大法好啊。reboot之后发现一切恢复正常,神奇的机器,估计是升级的时候数据库连接断了,typecho又没有自动重连的功能,没学过php,懒得管,反正能用就行(大误)。那...就算升级完成了吧,折腾别的去了,告辞。