Overview:

As discussed in many threads and Stack Overflow postings, collation settings were not as important in MySQL V5.OLDDAYS. With MySQL 5.5 onward, the impact of collation is significant. Collation inconsistencies can be the cause of various perplexing undecipherable DDL errors, such as when setting foreign keys on fields with different collation settings. Also, the session collation is referenced within data-structure dump script variables generated through the stock MySQL Workbench data export functions.

Prerequisite:

  • MySQL Workbench and connectivity to your dev environment instance
  • You know what collation is best for your needs. See MySQL Documentation
  • See disclaimer

Procedure:

The following is a simple script that I execute within a Query tab every time I startup MySQL Workbench. It sets collation and provides a quick sanity check. Of course, the specific collation differs between development environments.

I chose utf8_unicode_ci for this example, as this is a typical collation used on my projects.

I am not sure why these session settings are not available in MySQL Workbench. Maybe this article can serve as a “call to action”.

MySQL Session Collation Script:

SET NAMES utf8;
SET character_set_client = utf8;
SET character_set_connection = utf8;
SET collation_connection = utf8_unicode_ci;

show variables like '%char%';
show variables like '%collation%'

 

BitBucket Repo and Project Code

This is one of those things I use everyday. Hope it is helpful.
Like and link Pls.
paulsDevBlog.End();