最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

database - How to stop WordPress using utf8mb4_unicode_520_ci collation?

programmeradmin0浏览0评论

Recently I've installed PHP7 on my MAMP and updated to newest version of WordPress. Every time I do a new site all my tables are using collation utf8mb4_unicode_520_ci

I have tried setting define('DB_COLLATE', 'utf8_general_ci'); in my wp-config.php which worked fine until Gravity Forms ignored it and created all it's tables in utf8mb4_unicode_520_ci

I've seen that if utf8mb4_unicode_520_ci is available it will use that so is there a surefire way to stop WP using that collation? Can I just remove that collation as I am having to run 10 ALTER TABLE queries before I can port the database over to staging/live server?

Recently I've installed PHP7 on my MAMP and updated to newest version of WordPress. Every time I do a new site all my tables are using collation utf8mb4_unicode_520_ci

I have tried setting define('DB_COLLATE', 'utf8_general_ci'); in my wp-config.php which worked fine until Gravity Forms ignored it and created all it's tables in utf8mb4_unicode_520_ci

I've seen that if utf8mb4_unicode_520_ci is available it will use that so is there a surefire way to stop WP using that collation? Can I just remove that collation as I am having to run 10 ALTER TABLE queries before I can port the database over to staging/live server?

Share Improve this question edited Mar 19, 2017 at 16:13 wogsland 1851 gold badge4 silver badges13 bronze badges asked Sep 27, 2016 at 21:29 benpalmerbenpalmer 2662 silver badges6 bronze badges 6
  • 1 Should there be a good reason for this? Why do you have to convert? – Nathan Powell Commented Sep 28, 2016 at 5:58
  • Gravity forms is powerful, but do you need it? If you do, maybe your system should support it. – Nathan Powell Commented Sep 28, 2016 at 6:01
  • bumping this. I have the same problem. My local machine has a higher version of MySQL. I used to be able to do a sync of DB to deploy my sites. Now because of the different collation, I can't sync anymore. This is a huuuugge problem. – resting Commented Oct 5, 2016 at 2:51
  • I have the same issue while developing locally. Pushing up to my live database is always a pain because it never likes that collation. – Tex0gen Commented Nov 1, 2016 at 10:41
  • If this is an issue specific to the plugin, then you should open up a ticket on the WordPress.Org page for the plugin. – Cedon Commented Mar 19, 2017 at 19:21
 |  Show 1 more comment

2 Answers 2

Reset to default 3

Not using utf8mb4_unicode.... collation and using a utf8 one instead is a security problem. The right answer is to upgrade your sites and DBs so they all use utf8mb4

I ran into a similar issue while deploying sites using BackupBuddy. Ninja Forms was constantly creating tables in unicode_520_ci, no matter what settings I used in Sequel Pro.

Not sure if this helps or not, but all I had to do was change the collation within Sequel Pro for the specific Ninja Forms tables, and then the deployment would work as normal.

发布评论

评论列表(0)

  1. 暂无评论