mariadb版本降级

Posted yanwuliu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mariadb版本降级相关的知识,希望对你有一定的参考价值。

起因:

在工作中可能遇到这样一种情况:升级时发现备份的sql表列太宽,以至于出现以下错误:

Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

技术图片

这时候就要进行版本回退,将宽表修改后重新备份,然后再升级。

降级步骤:

0、查看已有yum源:

[[email protected] ~]# yum repolist all
已加载插件:fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
仓库标识                      仓库名称                      状态
cdrom                          cdrom                       启用: 6,575
repolist: 6,575

1、将yum源移除:

[[email protected] mysql]# yum list mariadb
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Available Packages
mariadb.x86_64         1:5.5.60-1.el7_5          local
[[email protected] mysql]# cd /etc/yum.repos.d/
[[email protected] yum.repos.d]# ls
backup  local.repo  MariaDB.repo  nginx.repo
[[email protected] yum.repos.d]# mv local.repo backup/
[[email protected] yum.repos.d]# mv nginx.repo backup/

2、清除yum源缓存后生成cache:

[[email protected] yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: mariadb
Cleaning up list of fastest mirrors
Other repos take up 101 M of disk space (use --verbose for details)
[[email protected] yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
mariadb                                             | 2.9 kB  00:00:00
(1/3): mariadb/primary_db                  |  54 kB  00:00:01
(2/3): mariadb/other_db                      | 9.2 kB  00:00:00
(3/3): mariadb/filelists_db                    | 281 kB  00:00:13
Metadata Cache Created

3、查看已安装的mariadb:

[[email protected] yum.repos.d]# yum list mariadb*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Installed Packages
MariaDB-client.x86_64               10.3.15-1.el7.centos                      @mariadb
MariaDB-common.x86_64      10.3.15-1.el7.centos                      @mariadb
MariaDB-compat.x86_64            10.3.15-1.el7.centos                      @mariadb
MariaDB-server.x86_64            10.3.15-1.el7.centos                      @mariadb
Available Packages
MariaDB-backup.x86_64          10.3.15-1.el7.centos                      mariadb
MariaDB-backup-debuginfo.x86_64        10.3.15-1.el7.centos         mariadb
MariaDB-cassandra-engine.x86_64     10.3.15-1.el7.centos      mariadb
MariaDB-cassandra-engine-debuginfo.x86_64     10.3.15-1.el7.centos                      mariadb
MariaDB-client-debuginfo.x86_64      10.3.15-1.el7.centos     mariadb
MariaDB-common-debuginfo.x86_64      10.3.15-1.el7.centos     mariadb
MariaDB-connect-engine.x86_64           10.3.15-1.el7.centos       mariadb
MariaDB-connect-engine-debuginfo.x86_64     10.3.15-1.el7.centos     mariadb
MariaDB-cracklib-password-check.x86_64     10.3.15-1.el7.centos      mariadb
MariaDB-cracklib-password-check-debuginfo.x86_64   10.3.15-1.el7.centos                      mariadb
MariaDB-devel.x86_64        10.3.15-1.el7.centos                      mariadb
MariaDB-devel-debuginfo.x86_64     10.3.15-1.el7.centos    mariadb
MariaDB-gssapi-server.x86_64      10.3.15-1.el7.centos           mariadb
MariaDB-gssapi-server-debuginfo.x86_64    10.3.15-1.el7.centos        mariadb
MariaDB-oqgraph-engine.x86_64       10.3.15-1.el7.centos      mariadb
MariaDB-oqgraph-engine-debuginfo.x86_64     10.3.15-1.el7.centos   mariadb
MariaDB-rocksdb-engine.x86_64       10.3.15-1.el7.centos    mariadb
MariaDB-rocksdb-engine-debuginfo.x86_64    10.3.15-1.el7.centos   mariadb
MariaDB-server-debuginfo.x86_64       10.3.15-1.el7.centos   mariadb
MariaDB-shared.x86_64           10.3.15-1.el7.centos                      mariadb
MariaDB-shared-debuginfo.x86_64       10.3.15-1.el7.centos    mariadb
MariaDB-test.x86_64               10.3.15-1.el7.centos                      mariadb
MariaDB-test-debuginfo.x86_64       10.3.15-1.el7.centos       mariadb
MariaDB-tokudb-engine.x86_64         10.3.15-1.el7.centos           mariadb
MariaDB-tokudb-engine-debuginfo.x86_64      10.3.15-1.el7.centos   mariadb

4、卸载已安装的mariadb:

[[email protected] yum.repos.d]# yum remove MariaDB-client MariaDB-common.x86_64 MariaDB-compat.x86_64 MariaDB-server.x86_64 -y

5、查看是否卸载完全:

[[email protected] yum.repos.d]# systemctl status mariadb
Unit mariadb.service could not be found.
[[email protected] yum.repos.d]# systemctl status mysql
Unit mysql.service could not be found.
[[email protected] yum.repos.d]# systemctl status mysqld
Unit mysqld.service could not be found.

6、安装低版本的yum源:

[[email protected] yum.repos.d]# mv MariaDB.repo backup/
[[email protected] yum.repos.d]# mv backup/local.repo  .

7、更新yum源:

[[email protected] yum.repos.d]# yum clean all
[[email protected] yum.repos.d]# yum makecache

8、安装低版本mariadb:

[[email protected] yum.repos.d]# yum install -y mariadb mariadb-server

 

以上是关于mariadb版本降级的主要内容,如果未能解决你的问题,请参考以下文章

错误记录Android Studio 编译报错 ( Could not determine java version from ‘11.0.8‘. | Android Studio 降级 )(代码片段

如何在 Windows 上降级 keras 和 tensorflow 版本?

如何降级 gcc 编译器?

Android_Install 版本降级失败

如何将 Chrome 版本从版本 94.0.4606.71 降级到版本 94.0.4606.61

Android 数据库降级怎么处理啊?