Forum Discussion
Refresh data error: Character set 'utf8mb3' is not supported by .Net Framework
When I try refreshing dataset I get error:
An error happened while reading data from the provider: 'Character set 'utf8mb3' is not supported by .Net Framework.'
Used to work fine before, I get data from a remote MySQL database on AWS server Checked collation of columns is utf8mb4_unicode_ci
I use:
- .Net framework version: 4.8
- MySQL connector version: 8.0.16 Also tried on latest version
- Power BI Desktop version: 2.100.1182.0 64-bit (December 2021)
I'm able to get the database tables in MySQL Workbench and HeidiSQL
Furthermore, I checked all db server config settings are all set to utfmb4
- Tested on 3 previous versions of Power BI
- Tested on 3 pervious versions of MySQL connectors
- Tested on 2 versions of data gateways
Any idea?
The issue has been resolved.
The report was previously built based on MySQL database data sourceOn server side MySQL database has been converted to MariaDB which caused utf8mb3 errors when establishing connection.
Updating and downgrading of .Net framework didn't resolve the issue.The connection was re-established successfully using connector-odbc-3.1.4 available on https://downloads.mariadb.com/Connectors/odbc/connector-odbc-3.1.4/And data source settings I changed from MySQL Database to MariaDB, which resulted in datasets being treated as a completely new source, eventually all worked as before.
23 Replies
- azaidiNew Member
For all those still struggling with the issue. Please download the latest so far 8.0.29 version of MySQL .Net Connector from MySQL :: Download Connector/NET
and add below text to C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
under
<DbProviderFactories>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>Cheers
- mubarakmayyeriNew Member
Thanks a lot, bro. Have been searching everywhere for a solution to this problem. I am using .Net version 8.0.30, I changed this in your code and it worked like a charm.....
- DunoNew Member
Thanks a lot! it worked with version Version=8.0.30.0, thanks again!
- Rajesh9021New Member
Hi , i installed version 8.0.33.
<DbProviderFactories>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.33.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
After adding this , getting different problem , as like this ,
failureCould not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Please help advise me Thanks a lot.
- jorgecastro2022New Member
Edit this file
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
And this file
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
- itimaticFrequent Visitor
The issue has been resolved.
The report was previously built based on MySQL database data sourceOn server side MySQL database has been converted to MariaDB which caused utf8mb3 errors when establishing connection.
Updating and downgrading of .Net framework didn't resolve the issue.The connection was re-established successfully using connector-odbc-3.1.4 available on https://downloads.mariadb.com/Connectors/odbc/connector-odbc-3.1.4/And data source settings I changed from MySQL Database to MariaDB, which resulted in datasets being treated as a completely new source, eventually all worked as before.- AnonymousNot applicable
It worked for few users when we updated .NET Framework
Thanks
- ludozilaNew Member
Comigo funcionou após upgrade de versão, a versão anterior do meu era o 8.0.18 e agora está na versão 8.0.32
- codepounderNew Member
This issue has been reported as a bug at MySQL starting with version 8.0.29.
MySQL Bugs: #107259: Character Set 'utf8mb3' is not supported by .Net Framework
(https://bugs.mysql.com/bug.php?id=107259)
Whether it's a "bug" or just a breaking change in MySQL is debatable, but the default character set in the system database information_schema changed from utf8 to utf8mb3. The .Net framework connector for MySql doesn't understand this.
If you don't have the option to change to a different connection stack, going back to MySQL 8.0.28 solved the problem for me. The issue still exists in MySQL 8.0.30, and I'm not sure if they'll change it in a future version.
- PhilriNew Member
download 8.0.32
- mrluttonAdvocate II
This is ridiculous. A simple mySQL connection should not be a problem taking hours to resolve. I will try the ODBC option but why is this an ongoing issue in 2023?
- HirenPatelNew Member
for me, I have tried each and everything. even tried with latest version of connector as well as mysql server/workbenche/shell (9.0.0). at the end for me net connector 8.0.26.0 and same 8.0.26.0 mySQL version worked for me. Maybe whoever has problem, can try with old version.
- AnonymousNot applicable
Unable to connect
we encountered an error while trying to connect
Details: "An error happened while reading data from the provider: 'Character set 'utf8mb3' is not supported by .Net Framework.'"
even after downgrading i am vexd off with this powerbi connector it takes a longer time than i think can you help me resolving this issue
- itimaticFrequent Visitor
No one had this issue before?? Anyone there?
- azaidiNew Member
I have posted the solution incase.
- Syndicate_AdminAdministrator
Hello!! If I have the same problem since they updated the version of MySQL one of my boards can not connect. I looked everywhere but I can't find the solution.
If anyone can give us a hand please! - AnonymousNot applicable
Here we go issue with tables and columns setting in MySQL. evern if you update default server setting you still have to do each table and column
-- TABLES
select CONCAT('alter table ',TABLE_SCHEMA,'.',TABLE_NAME,' charset=utf8mb4;') command
from information_schema.TABLES
WHERE TABLE_SCHEMA = 'DB Name';Email me if you need help [email protected]
-- COLUMNS
select concat('ALTER TABLE ',TABLE_Name, ' MODIFY `',COLUMN_NAME, '` ' , COLUMN_TYPE, ' CHARACTER SET utf8mb4;') command
from information_schema.COLUMNS
WHERE TABLE_SCHEMA = 'DB NAME HERE'
and CHARACTER_SET_NAME = 'utf8mb3';