Re: MySqlConnectionStringBuilder CharacterSet Property
Hi Ben,
The documentation text you quoted appears to be for the third-party MySqlConnector library, not Oracle’s MySql.EntityFrameworkCore / MySql.Data provider.
With MySQL Connector/NET, CharacterSet is a supported connection option. If you leave it blank, the connection uses the server/session default character set. If that default is not utf8mb4, Unicode characters outside that character set can be converted incorrectly, often appearing as question marks.
Setting:
CharacterSet = "utf8mb4"
is therefore a valid workaround/recommendation when your application stores Unicode text, provided the target database/table/columns also use utf8mb4.
To see what the session is actually using, query it after opening the connection:
SELECT
@@character_set_client,
@@character_set_connection,
@@character_set_results,
@@collation_connection;
or:
SHOW SESSION VARIABLES LIKE 'character_set_%';
SHOW SESSION VARIABLES LIKE 'collation_%';
The MySqlConnectionStringBuilder.CharacterSet property only shows what you explicitly put in the connection string. If it is blank, it does not mean the active MySQL session has no character set; it means the provider will use the server/session default.
You should also verify the schema:
SHOW FULL COLUMNS FROM your_table;
or check INFORMATION_SCHEMA to confirm that the database/table/columns are utf8mb4.
====================================
Jose Ramirez
MySQL Team
Subject
Written By
Posted
Re: MySqlConnectionStringBuilder CharacterSet Property
July 06, 2026 04:46PM
Sorry, only registered users may post in this forum.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.