1

I have a database for a site I am developing in WAMP. The collation for the database is latin1_swedish_ci but every table in the database is utf84mb_unicode_ci.

Should I be worried about this?

In the future I can use utf84mb_unicode_ci for both, but what about the databases I already have content in?

1

From quick check of the MySQL manual the database collation is only relevant for database–level operations (emphasis mine):

  • For CREATE TABLE statements, the database character set and collation are used as default values for table definitions if the table character set and collation are not specified. To override this, provide explicit CHARACTER SET and COLLATE table options.

  • For LOAD DATA statements that include no CHARACTER SET clause, the server uses the character set indicated by the character_set_database system variable to interpret the information in the file. To override this, provide an explicit CHARACTER SET clause.

  • For stored routines (procedures and functions), the database character set and collation in effect at routine creation time are used as the character set and collation of character data parameters for which the declaration includes no CHARACTER SET or COLLATE attribute. To override this, provide explicit CHARACTER SET and COLLATE attributes.

http://dev.mysql.com/doc/refman/5.7/en/charset-database.html

For WordPress it is table level collation that matters. That's why it actually can do things like creating/upgrading utf8mb4 tables inside a database that isn't.

So this seems to be non–issue and you could probably even set collation on existing databases without any trouble (not the same story at all with tables however!).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.