mysql Invalid column count in CSV input while importing csv file

前端 未结 2 2033
误落风尘
误落风尘 2020-12-22 06:03

I have a table in the database called locations which contains 2 columns(id which is auto incremented , location) , And I have a csv c

2条回答
  •  被撕碎了的回忆
    2020-12-22 06:27

    If Java is supported in your machine, Use below solution

    https://dbisweb.wordpress.com/

    The simple configuration required to do is

    
    
      
          
              com.mysql.jdbc.Driver
              jdbc:mysql://localhost:3306/test1
              root
              
          
      
      
          
              
                  
                      
                  
                  
                      locations

    If you are interested, Same can be achieved by Java code.

    Source source = new File("D:/test_source.csv", ',', false);
            Destination destination = new Table("locations", new JDBCConnection("com.mysql.jdbc.Driver", "jdbc:mysql://localhost:3306/test1", "root", ""));
            List mapping = new ArrayList<>();
            mapping.add(new Mapping("1", "location", null));
            Component component = new MigrateExecutor(source, destination, mapping);
            component.execute();
    

提交回复
热议问题