mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Optimize code
This commit is contained in:
@@ -62,9 +62,14 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
Check.ExceptionEasy("connection string add : AllowLoadLocalInfile=true", "BulkCopy MySql连接字符串需要添加 AllowLoadLocalInfile=true; 添加后如果还不行Mysql数据库执行一下 SET GLOBAL local_infile=1 ");
|
Check.ExceptionEasy("connection string add : AllowLoadLocalInfile=true", "BulkCopy MySql连接字符串需要添加 AllowLoadLocalInfile=true; 添加后如果还不行Mysql数据库执行一下 SET GLOBAL local_infile=1 ");
|
||||||
}
|
}
|
||||||
else
|
else if (ex.Message == "Loading local data is disabled; this must be enabled on both the client and server sides")
|
||||||
{
|
{
|
||||||
throw ex;
|
this.Context.Ado.ExecuteCommand("SET GLOBAL local_infile=1");
|
||||||
|
Check.ExceptionEasy(ex.Message, " 检测到你没有开启文件,已自动执行 SET GLOBAL local_infile=1 在试一次");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
Reference in New Issue
Block a user