MovableType 7 安装错误: Specified key was too long

在尝试安装 MovableType 7 的时候,一路顺利,到最后初始化数据库的时候,出现了一个错误。

Error during installation: failed to execute statement ALTER TABLE mt_ts_funcmap ADD CONSTRAINT mt_ts_funcmap_funcname UNIQUE (ts_funcmap_funcname): Specified key was too long; max key length is 767 bytes at lib/MT/Upgrade.pm line 839, line 1662.

mt7-install-error.jpg

如何修复这个错误?

简单而言就是修改数据库的 collection 参数。

MariaDB 10.1 的默认安装后,其数据库的默认 collection 是 utf8mb4_general_ci,偶尔在某些系统安装时会出现上面的错误情况。

最方便的办法,就是在安装 MovableType 7 之前,在添加数据库后,先把数据库的 collection 修改成 utf8_general_ci,修改的方法,有手工的,有使用 phpmyadmin,都可以。

如果你在网上搜索,Specified key was too long; max key length is 767 bytes,有很多种解释和所谓解决方法。比如 innodb_file_format,innodb_file_per_table,row_format, innodb_large_prefix 各种参数修改。对于 MovableType 7 的安装来说,都没有效果,唯有上面修改 collection 才是真正解决的方法。

安装 MovableType 7 成功后的界面是下面这样。

mt7-install-success.jpg

Update:

特地在 MovableType 6.3.7 的全新安装,当数据库的 collection 也是 utf8mb4_general_ci 时,同样在初始化数据库时出现下面错误。

mt6-install-error.jpg把数据库 collection 改成 utf8_general_ci 之后,点击安装,就没有问题了。

mt6-install-success.jpg

把网站放在Dreamhost,通过LinkWorth获取广告收益,每个链接高达$40。
G2links Web Directories

延伸阅读

安装 Ubuntu 18.04, Webmin, Nginx, MariaDB, PHP7.2-FPM,Perl-Fastcgi 到 Linode 的 VPS(3) MovableType 7 发布 RC1 MovableType 7 的 Beta 版发布了 MovableType 7.0 Alpha 版本试用 安装 Ubuntu 16.04, Webmin, Nginx, MariaDB, PHP7.1-FPM,Perl-Fastcgi 到 Vultr.com 的 VPS(3) 开放透明是我们信仰的核心价值之一 修复 AMP 页面错误 如何验证 AMP 页面 404错误中看到的收获 如何迁移到新VPS

文章来源:

Author:David Yin
link:https://seo.g2soft.net/2018/05/30/movabletype-7-specified-key-wa.html