fixed utf8mb3 error

master
Don Oerkfitz 3 years ago
parent 07990080ed
commit 18c4efdcd2

@ -12,7 +12,7 @@
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="5.0.0" />
<PackageReference Include="MySql.Data" Version="8.0.26" />
<PackageReference Include="MySql.Data" Version="8.0.25" />
<PackageReference Include="Quartz" Version="3.3.3" />
<PackageReference Include="Quartz.Jobs" Version="3.3.3" />
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.3" />

@ -29,7 +29,7 @@ namespace Common.Library.SQL.Base
case DBType.MSSQL:
break;
case DBType.MYSQL:
rv = string.Format("Server={0};Database={1};Uid={2};Pwd={3};SslMode=none", DBHost, DBName, DBUserName, DBPassword);
rv = string.Format("Server={0};Database={1};Uid={2};Pwd={3};", DBHost, DBName, DBUserName, DBPassword);
break;
}

@ -34,6 +34,10 @@ namespace Common.Library.SQL.MySQL
DBConnection = new MySqlConnection(DBConnectionInfo.GetConnectionString());
DBConnection.Open();
DBCommand = DBConnection.CreateCommand();
DBCommand.CommandType = CommandType.Text;
DBCommand.CommandText = "SET character_set_results=utf8mb4";
DBCommand.ExecuteNonQuery();
}
protected override void DisposeConnection()

Loading…
Cancel
Save