前言介紹
- 這款 WordPress 外掛「Database Collation Fix」是 2017-04-21 上架。
- 目前有 1000 個安裝啟用數。
- 上一次更新是 2024-01-17,距離現在已有 473 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.6 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.3.1 以上。
- 有 20 人給過評分。
- 論壇上目前有 1 個提問,問題解答率 0%
外掛協作開發者
外掛標籤
export | database | migration | collation algorithm | utf8mb4_unicode_520_ci |
內容簡介
自從 WordPress 4.2 版本開始,WordPress 偵測 MySQL 版本,如果是 5.5.3 版本以上,會自動選擇使用「utf8mb4_unicode_520_ci」校對演算法。這在未來的資料庫移轉時有些問題,因為較舊版本的 MySQL 不支援 utf8mb4 校對演算法,你可能會遇到「#1273 - Unknown collation: 'utf8mb4_unicode_520_ci'」的錯誤訊息。
而在 WordPress 5.7 和 WooCommerce 5.1 更新後,有些使用者報告一個錯誤:「SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (utf8mb4_unicode_520_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT)」。這時,Database Collation Fix 外掛可以解決這個問題,透過將資料庫中所有欄位的校對演算法改為相同方式,移除了混合的校對演算法。
使用情境:
雖然這個外掛在任何 WordPress 站台(包括本機、測試或正式站)都可以運作,但它特別設計給 DesktopServer 使用。在任何 DesktopServer 操作(包括建立新站台、複製站台、移動站台、匯入匯出等)時,都會觸發此外掛,將所有資料表中的校對演算法改為相容性更高的方式,以便在部署時更容易匯入和匯出站台。如果你想在 DesktopServer 中使用此外掛作為設計時外掛,可以安裝在「/xampplite/ds-plugins/」資料夾,就可以自動啟用在所有本機開發站台使用。如果你需要更多關於 DesktopServer 和本機開發工具的資訊,請參考我們的網站:https://serverpress.com/get-desktopserver/。
另外,你也可以像一般 WordPress 外掛一樣,在任何站台上安裝此外掛。啟用後,此外掛會將你的資料庫中所有表格的校對演算法更新為更易移轉的方式。如果你正在移轉你的站台,可以安裝和啟用此外掛,然後執行資料庫匯出動作。移轉完成後,你可以停用或刪除此外掛。如果你需要再次匯出或移轉站台,可以持續啟用此外掛,它將自動監控並自動更新你的資料表格的校對演算法,方便在任何時刻執行移轉作業。這在你安裝或測試可能會建立新的資料庫表格的擴充套件時非常有用,因為這些表格可能採用較新的校對演算法,導致不夠相容。
工作方式:
Database Collation Fix 工具每天將使用「utf8mb4_unicode_520_ci」或「utf8_unicode_520_ci」校對演算法的資料庫表格轉換成更易移轉的「utf8mb4_unicode_ci」校對演算法。它也會修改特定欄位的校對演算法,而不僅是預設表格的校對演算法。這意味著你可以安裝此外掛,它將繼續監視並自動將所有資料表格轉換為更易移轉的校對演算法。
此外掛將將您的資料庫表格和欄位轉換為使用「utf8mb4_unicode_ci」校對演算法。這可以透過編輯「wp-config.php」檔案,並添加或更改以下設定進行修改:
define('DB_COLLATE', 'utf8_general_ci');
你可以將其修改為你想使用的任何其他校對演算法──例如「utf8_general_ci」或「utf8」,或任何你的資料庫支援的校對演算法。詳細資訊請參考 https://dev.mysql.com/doc/refman/5.7/en/charset-mysql.html。
原文外掛簡介
Since version 4.2, WordPress has been detecting the MySQL version and if it’s version 5.5.3 or greater, automatically selecting the ‘utf8mb4_unicode_520_ci’ Collation Algorithm. This works well until you need to migrate your database to an older version of MySQL that does not support the utf8mb4 algorithms. Then, you run into the error message: “#1273 – Unknown collation: ‘utf8mb4_unicode_520_ci'” when importing your database.
With the WordPress 5.7 update and WooCommerce 5.1, some users are reporting an error: “SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (utf8mb4_unicode_520_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT)”. The Database Collation Fix tool also fixes this issue by changing the collation of all columns in your database to use the same algorithm, removing the “mix” of collations.
Usage Scenarios:
While the plugin will work in any WordPress install: local, staging or live, it is specially designed to work with DesktopServer. Its process will be triggered and change the collation types on all database tables during any DesktopServer Create Site, Copy Site, Move Site, Import and Export operations. This allows you to import and export sites in the most compatible ways during deployments. If you would like to use this with DesktopServer as a Design Time plugin, you can install this in your /xampplite/ds-plugins/ directory and it can then be automatically activated and used with all of your local development web sites.
Alternatively, you can install this as a regular WordPress plugin on any site. Once activated, all of your database tables will be updated to use the more portable Collation Algorithm. If you are migrating your web site, you can install and activate the plugin then perform your database export. Once you have migrated your site, you can deactivate and remove the plugin as it would be no longer needed. If you will be exporting and/or migrating your site repeatedly, such as when using it on a test or staging install, you can leave the plugin active indefinitely and it will continue to monitor and update your database tables automatically, allowing you to perform migrations at any time. This is ideal in situations where you are installing or testing plugins that may create their own database tables, as these tables may be created with the newer Collation Algorithms that are not as portable.
How it Works:
The Database Collation Fix tool converts database tables using ‘utf8mb4_unicode_520_ci’ or ‘utf8_unicode_520_ci’ Collation Algorithms to a more portable ‘utf8mb4_unicode_ci’ collation on a once daily basis. It also modifies any column-specific collation statements, not just the default table collation. This means that you can install this plugin and it will continue to monitor all of your database tables and convert them to the more portable Collation Algorithm automatically.
This tool will convert your database tables and columns to use the ‘utf8mb4_unicode_ci’ Collation Algorithm. This can be modified to any other Collation Algorithm you wish by updating your wp-config.php file and adding or changing the following setting:
define('DB_COLLATE', 'utf8_general_ci');
You can use ‘utf8_general_ci’ or ‘utf8’ or any other Collation Algorithm supported by your database. See https://dev.mysql.com/doc/refman/5.7/en/charset-mysql.html for a full description of MySQL’s Character Set and Collation Algorithm selections.
Support:
Support Details: We are happy to provide support and help troubleshoot issues. Visit our Contact page at http://davejesch.com/contact/ or submit a support request on the WordPress plugin page.
We are not responsible for any loss of data that may occur as a result of using this tool. We strongly recommend performing a site and database backup before testing and using this tool. However, should you experience such an issue, we want to know about it right away.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Database Collation Fix」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
暫無相關外掛推薦。