C# 读取Mysql information_schema 表时报 Character set 'utf8mb3' is not supported by .Net Framework.
//网上搜索结果让添加charset=utf8mb4;",测试还是不行,最后放弃用Mysql官方的System.Data.Mysql.dll的引用,不用这个改用MySqlConnector,就可以正常用了,using MySqlConnector;。
这个错误是因为 MySQL 的 utf8mb3 字符集在 .NET Framework 中不被支持导致的。utf8mb3 是 MySQL 早期对 UTF-8 的实现,而 .NET Framework 只支持标准的 UTF-8(对应 MySQL 的 utf8mb4)。
// 在连接字符串中添加字符集设置
string connectionString = "server=localhost;database=information_schema;uid=root;pwd=password;charset=utf8mb4;";