解决nextcloud配合mariadb10.6使用时安装程序报错的问题
in with 0 comment

解决nextcloud配合mariadb10.6使用时安装程序报错的问题

in with 0 comment

请注意时效性!这篇文章在2021年11月16日写就,未来Nextcloud应当会修复该问题。

起因

当我在VPS上配置Nextcloud时,安装程序给我报了如下错误。

Error while trying to initialise the database: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE. 

搜索后我找到了这篇Issue,有两个解决方案,请任选其一

解决方案1

启动MariaDB10.6时使用--skip-innodb-read-only-compressed参数。

根据InnoDB COMPRESSED Row Format所说,COMPRESSED特性将在未来弃用,不推荐该方法。

MariaDB starting with 10.6
From MariaDB 10.6.0, tables that are of the COMPRESSED row format are read-only by default. This is the first step towards removing write support and deprecating the feature.
Set the innodb_read_only_compressed variable to OFF to make the tables writable.

解决方案2

修改nextcloud目录下lib/private/DB/ConnectionFactory.php288行,将'row_format' => 'compressed',替换为'row_format' => 'dynamic',

缺点在于nextcloud的完整性检测会报错,强迫症患者可能会受不了……