環境:MariaDB版本為5.5.60
解決方案 :Enabling MySQL 4-byte support
#vim /etc/my.cnf
在[mysqld]下加入
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=1
重啟服務
#systemctl restart mariadb
登入MariaDB
#mysql -uroot -p
下語法
MariaDB> ALTER DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
MariaDB> USE INFORMATION_SCHEMA;
MariaDB> SELECT CONCAT("ALTER TABLE `", TABLE_SCHEMA,"`.`", TABLE_NAME, "` ROW_FORMAT=DYNAMIC;") AS MySQLCMD FROM TABLES WHERE TABLE_SCHEMA = "nextcloud";
如果有跳錯 ERROR 1478 (HY000)
MariaDB> ALTER TABLE `nextcloud`.`oc_tablename` ROW_FORMAT=DYNAMIC, ALGORITHM=COPY;
修改config.php設定
#cd /var/www/nextcloud/
#vim config/config.php
‘mysql.utf8mb4’ => true,
#sudo -u nginx php occ maintenance:repair
完成,沒再跳錯了!