1.修改相应数据库的编码格式: -- 修改数据库编码为utf8 ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_general_ci; 2.修改所有的数据格式均为utf8 -- 修改数据为utf8 SET NAMES 'utf8' 3.查看修改后的结果: -- 查看是否为utf8编码数据 show variables like "%char%";
引用 using System.Runtime.InteropServices; [DllImport("kernel32.dll", EntryPoint = "GetSystemDefaultLCID")] public static extern int GetSystemDefaultLCID(); [DllImport("kernel32.dll", EntryPoint = "SetLocaleInfoA")] p