legacy-knowledge-base
公開されました Sep. 10, 2025

SQLException:インデックス・カラムのサイズが大きすぎます。 最大カラムサイズは767バイト。

written-by

Laura Li

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • プロダクションデータベース(MySQL)のコピーを使用して、Liferay 7.4 U62からU90へのアップグレードをテストしました。 アップグレードは以下のエラーで失敗しました:
    INFO  [main][UpgradeProcess:118] Upgrading com.liferay.portal.configuration.persistence.internal.upgrade.registry.ConfigurationPersistenceUpgradeStepRegistrator - Modifying table Configuration_ to alter the type of the column configurationId to VARCHAR(512) not null
    INFO  [main][UpgradeProcess:136] Failed upgrade process com.liferay.portal.configuration.persistence.internal.upgrade.registry.ConfigurationPersistenceUpgradeStepRegistrator - Modifying table Configuration_ to alter the type of the column configurationId to VARCHAR(512) not null in 348 ms          
    ERROR [main][UpgradeStepRegistratorTracker:178] Failed upgrade process for module com.liferay.portal.configuration.persistence.impl
    com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLException: Index column size too large. 最大カラムサイズは767バイト。

Environment

  • Liferay DXP 7.4

解決策

  • このエラーは、カラムにインデックスを作成するときに発生します。 通常は、データベースで設定されている文字セット/照合順序が異なることが原因です。 例えば、プロダクション・データベースはutf8mb4に設定され、ローカル・データベースはutf8に設定されます。 MySQLでは、utf8は3バイトまで、utf8mb4は4バイトまでです。 そのため、ローカルデータベースでutf8mb4でインデックスを作成すると失敗します。
  • 他の環境からデータベースのコピーを使用する場合は、ローカル環境で文字セット/照合順序が同じに設定されていることを確認してください。

did-this-article-resolve-your-issue

legacy-knowledge-base