0

I have selected utf8mb4_unicode_ci Collation (since this was recommended to use instead of latin..) in PhpMyAdmin in both options, in Server connection collation under General settings and in Database under Operations Tab of PhpMyAdmin but tables in that database which are of WordPress blog, are using utf8mb4_unicode_520_ci Collation (which can be seen on main window e.g by clicking on that database)

My Question is, is this any bad thing or does it have any negative effect that I have selected utf8mb4_unicode_ci but Database for WordPress blog is using utf8mb4_unicode_520_ci tables in Database. All of the tables in that database are using utf8mb4_unicode_520_ci.

1) Should I change options from utf8mb4_unicode_ci to utf8mb4_unicode_520_ci in PhpMyAdmin (in both places as mentioned above)

2) Or it does not have any bad effect, I should leave it, as it is.

hoping to get answer for this query. Thank You for reading.

Jack
  • 1
  • 1
  • collation will affect string comparison as far as i know. and its ok to have database collation and table collation different. however, it may result in [weird result](https://bugs.mysql.com/bug.php?id=28768) in case you are comparing two table with different collation. actually the suggestion to use `utf8mb4_unicode_ci` is when you are developing your own application, but since its wordpress.. we can do nothing much about it without changing the table ourselves - which may in turn broke wordpress.. – Bagus Tesa Sep 07 '18 at 01:36
  • It was recommend by WordPress Offfical Core Development team to use utf8mb4 source : https://make.wordpress.org/core/2015/04/02/the-utf8mb4-upgrade/ ... so now should I leave this as it as? – Jack Sep 07 '18 at 09:26
  • Hi @Jack, the problem is your wordpress already using `utf8mb4_unicode_520_ci` collation which had [a bit of backward compatibility](https://stackoverflow.com/a/37308117/4648586). while the article you shared is already 3 years old and refers to old wordpress 4.2. i believe it is better to leave as it is -- yours already 4.9 right? if yes, no need to worry. – Bagus Tesa Sep 07 '18 at 11:15
  • yep, I have latest version of WP installed. – Jack Sep 07 '18 at 22:16

1 Answers1

0

When doing CREATE TABLE ..., the collation comes from:

  • You can explicitly state the collation with the CREATE, or
  • Defaulting to the database's collation (CREATE DATABASE ...)

Similarly, when declaring a column, you can be either explicit or default to the TABLE's settings.

I prefer to be explicit, not letting things default.

There is no harm when the database / table / column disagree on CHARACTER SET and/or COLLATION.

Until you get to MySQL 8.0, utf8mb4_unicode_520_ci is the "best" collation. (Best according to the Unicode standards committee.)

Rick James
  • 135,179
  • 13
  • 127
  • 222