KNOWLEDGE BASE

Error "[MySQL][ODBC 5.3(w) Driver]Unknown character set: 'utf8mb4'" When connecting to MySQL


Published: 30 Oct 2019
Last Modified Date: 30 Oct 2019

Issue

When connecting to MySQL, either via Tableau Desktop or Tableau Server, or via a DNS test, the MySQL Unicode driver returns the error

"[MySQL][ODBC 5.3(w) Driver]Unknown character set: 'utf8mb4'".


Additional information regarding this scenario:

  • This error will only occur when connecting to MySQL server pre-version 5.5.3.
  • This error will only occur with MySQL ODBC drivers version 5.3.11 or greater.

Environment

  • Tableau Desktop
  • Tableau Server
  • MySQL

Resolution

To avoid this error, use one of the following solutions:

Option 1

Downgrade to an earlier MySQL driver version (pre 5.3.11).

Option 2

Upgrade your MySQL server to version 5.5.3 or later, where the UTF8MB4 character set is supported.

Option 3

Use the generic ODBC connector from Tableau, and connect using the MySQL ANSI driver, instead of the default Unicode driver (please note that connections using the generic ODBC connector are not supported and may result in limited functionality). 

Cause

Beginning with version 5.3.11 and greater, the MySQL ODBC driver began using the UTF8MB4 character set, instead of UTF8. However, support for the UTF8MB4 character set was not added to MySQL server until version 5.5.3, so connecting to any server version earlier than this will result in the above error.

Additional Information

For more information on this change, see the following MySQL documentation:
  • MySQL Connector/ODBC 5.3.11 release notes:
    • "The Unicode version now uses the UTF8MB4 character set as a transport character set between the MySQL server and the ODBC driver."
  • MySQL 5.5.3 server release notes:
    • "The utf8mb4 character set has been added. This is similar to utf8, but its encoding allows up to four bytes per character to enable support for supplementary characters."
Did this article resolve the issue?