将 MariaDB 10.11 升级到 11.3

问题描述 投票:0回答:1

我在不同的服务器上运行 MariaDB 10.11,并想升级到 11.x 一段时间,但升级遇到困难。 我停止 MariaDB。卸载旧版本并安装例如11.3。然后我总是得到

[ERROR] InnoDB: The change buffer is corrupted
。我可以进行转储并在升级后导入转储,并获取所有数据,甚至包括历史记录(我使用系统版本表)。但是,即使 mysql.user 中有密码,我的用户也可以在没有密码的情况下登录。 我用

加密了数据库
plugin_load_add = file_key_management
loose_file_key_management_filename = /etc/mysql/encryption/keyfile.enc
loose_file_key_management_filekey = FILE:/etc/mysql/encryption/keyfile.key
loose_file_key_management_encryption_algorithm = AES_CTR
innodb_encrypt_tables = ON
innodb_encrypt_temporary_tables = ON
innodb_encrypt_log = ON
innodb_encryption_threads = 4
innodb_encryption_rotate_key_age = 1

升级后错误的完整日志:

Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] Starting MariaDB 11.3.2-MariaDB-1:11.3.2+maria~ubu2204 source revision 068a6819eb63bcb01fdfa037c9bf3bf63c33ee42 as process 115>
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Number of transaction pools: 1
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Using liburing
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Completed initialization of buffer pool
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Resetting space id's in the doublewrite buffer
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: End of log at LSN=658042216301
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [ERROR] InnoDB: The change buffer is corrupted
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Starting shutdown...
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] Plugin 'FEEDBACK' is disabled.
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] Plugin 'wsrep-provider' is disabled.
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [ERROR] Unknown/unsupported storage engine: InnoDB
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [ERROR] Aborting

我以为我可以安装新版本并运行

mariadb-upgrade
,一切正常。 如果我安装 11.3 并导入转储,我无法运行
mariadb-upgrade
,因为它说它已经升级了。 我尝试了不同的 MariaDB 版本,但这似乎没有什么区别。

mariadb mariadb-11
1个回答
0
投票

抱歉,您的更改缓冲区已损坏。幸运的是,它现在已被删除,一旦解决这个问题,就不会造成进一步的问题。

要从早期版本获取 SQL 迁移中的用户,请保存他们及其授权:

mariadb-dump --system=users --insert-ignore > /tmp/users.sql

然后导入到升级后的实例中。如果您使用

--replace
替换现有用户,您将需要一个不在原始高权限实例中的新用户才能导入用户:

MariaDB [(none)]> create user import_user@localhost;
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> grant all on *.* to import_user@localhost with grant option;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> grant proxy ON ''@'%' to import_user@localhost with grant option;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> ^DBye

使用 import_user 重新启动客户端并像之前一样导入用户;

mariadb -u  import_user

MariaDB [(none)]> \. /tmp/users.sql
Query OK, 0 rows affected (0.000 sec)
....

MariaDB [(none)]>  drop user import_user@localhost;
Query OK, 0 rows affected (0.001 sec)
© www.soinside.com 2019 - 2024. All rights reserved.