【运维】Linux 离线升级指定版本的MariaDB

【运维】Linux 离线升级指定版本的MariaDB 

目录

【运维】Linux 离线升级指定版本的MariaDB 

1.下载要更新的MariaDB 安装包

2.参考安装过程 解压安装包

3.进入解压的目录

4. 最后升级mariadb

5.查询当前mariadb版本是否是升级之后的版本


以Debian系统为例

1.下载要更新的MariaDB 安装包

Download MariaDB Products & Tools | MariaDB

wget https://dlm.mariadb.com/3895090/MariaDB/mariadb-11.5.2/repo/debian/mariadb-11.5.2-debian-bookworm-amd64-debs.tar

2.参考安装过程 解压安装包

tar -xvf mariadb-11.5.2-debian-bookworm-amd64-debs.tar

3.进入解压的目录

cd mariadb-11.5.2-debian-bookworm-amd64-debs/

执行

./setup_repository

注意:如果这里提示已存在则重命名该文件

[ERROR] File "/etc/apt/sources.list.d/mariadb.list" already exists. Rename it and re-run this script, or manually create a new .repo file.

重命名该文件  /etc/apt/sources.list.d/mariadb.list  改为 /etc/apt/sources.list.d/mariadb.listbak

或者删除该文件

然后接着执行

 ./setup_repository

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
Repository file successfully created! Please install MariaDB Server with this command:

   apt-get update && apt-get install mariadb-server

4. 最后升级mariadb

apt-get update && apt-get upgrade mariadb-server

或者升级全部

apt-get update && apt-get upgrade -y

注意:升级中途可能会遇到冲突的配置,根据实际情况进行选择 

Configuration file '/etc/mysql/mariadb.conf.d/50-server.cnf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** 50-server.cnf (Y/I/N/O/D/Z) [default=N] ? 
  • Y 或 I:安装包维护者的版本。这将覆盖您所做的任何自定义设置。
  • N 或 O:保持当前安装的版本。这意味着您将保留自己所做的任何更改。
  • D:显示两个版本之间的差异。
  • Z:启动一个 shell 以便您可以更详细地检查情况。

建议先 D 查看差异情况, 根据差异情况选择操作   :q 可以退出查看

我这里用的N,保留了自己所作的更改

输入N 回车即可

5.查询当前mariadb版本是否是升级之后的版本

mariadb> SELECT VERSION();
+----------------------+
| VERSION()            |
+----------------------+
| 11.5.2-MariaDB-deb12 |
+----------------------+
1 row in set (0.07 sec)

mariadb> 

  • 6
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我是Superman丶

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值