Image

知识库 → 在 Debian 12 上更新 MariaDB 服务器

[虚拟服务器]
出版日期: 16.09.2024

默认情况下,Debian 12 上安装的是 MariaDB 10.x 版本,但某些应用程序需要更新的版本。该指南描述了如何升级到 MariaDB 11.3 版本。

1. 添加存储库

/etc/apt/sources.list.d/
apt install curl
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-11.3"

2. 更新已安装的软件包

apt update
apt upgrade
systemctl stop mariadb
apt install --only-upgrade mariadb-server
apt autoremove
systemctl daemon-reload
systemctl start mariadb

2.1 如果启动时出错,请在配置文件中注释相关行

/etc/mysql/mariadb.conf.d/

provider_bzip2.cnf
#provider_bzip2=force_plus_permanent

provider_lz4.cnf
#provider_lz4=force_plus_permanent

provider_lzma.cnf
#provider_lzma=force_plus_permanent

provider_lzo.cnf
#provider_lzo=force_plus_permanent

provider_snappy.cnf
#provider_snappy=force_plus_permanent

3. 更新数据库

service mariadb restart
mariadb-upgrade

如有需要,可使用密码进行操作:

mariadb-upgrade -u root -p

完成。你可以通过以下命令检查 MariaDB 版本:

dpkg -l | grep mariadb

或者

mariadb

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 11.3.2-MariaDB-1:11.3.2+maria~deb12 mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.




暂时没有评论