From cf524fd2d9de45f3a25399e4c1fea0ca88dae523 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Thu, 16 Jun 2022 14:58:09 +0800 Subject: [PATCH] Optimization error message --- .../Realization/MySql/SqlBuilder/MySqlFastBuilder.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/MySql/SqlBuilder/MySqlFastBuilder.cs b/Src/Asp.NetCore2/SqlSugar/Realization/MySql/SqlBuilder/MySqlFastBuilder.cs index f1bac3592..462d5c4b2 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/MySql/SqlBuilder/MySqlFastBuilder.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/MySql/SqlBuilder/MySqlFastBuilder.cs @@ -58,7 +58,14 @@ namespace SqlSugar } catch (MySqlException ex) { - throw ex; + if (ex.Message == "The used command is not allowed with this MySQL version") + { + Check.ExceptionEasy("connection string add : AllowLoadLocalInfile=true", "BulkCopy MySql连接字符串需要添加 AllowLoadLocalInfile=true; 添加后如果还不行Mysql数据库执行一下 SET GLOBAL local_infile=1 "); + } + else + { + throw ex; + } } finally {