麒麟v10 上部署 TiDB v5.1.2 生产环境优化实践
729
2023-07-02
mysql批量插入BulkCopy如何实现
一、新建项目:SqlSugarDemo
二、连接串未添加AllowLoadLocalInfile=true
中文提示 : BulkCopy MySql连接字符串需要添加 AllowLoadLocalInfile=true; 添加后如果还不行Mysql数据库执行一下 SET GLOBAL local_infile=1 English Message : connection string add : AllowLoadLocalInfile=true
show global variables like 'local_infile';SET GLOBAL local_infile=1登录后复制
三、Startup.cs
using Microsoft.AspNetCore.Builder;using Microsoft.AspNetCore.Hosting;using Microsoft.Extensions.Configuration;using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Hosting;using SqlSugar;using System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks; namespace WebApplication3{ public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddSingleton
HomeController.cs
using Microsoft.AspNetCore.Mvc;using Microsoft.Extensions.Logging;using SqlSugar;using System;using System.Collections.Generic;using System.Diagnostics;using System.Linq;using System.Threading.Tasks;using WebApplication3.Models; namespace WebApplication3.Controllers{ public class HomeController : Controller { private readonly ILogger
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。