What is the easiest way to import an excel sheet into mysql

后端 未结 3 367
终归单人心
终归单人心 2020-12-21 14:48

I have an Excel sheet with some cols and i want to import those into the mysql table. The Problem is that there are more colums in the mysql table than in the sheet (which

3条回答
  •  没有蜡笔的小新
    2020-12-21 15:43

    mysqlimport cmdline-tool has support for importing csv-files, and IIRC supports mapping of different columns in csv into different columns in your table.

    http://linux.die.net/man/1/mysqlimport

    I realize that it's just a cmd-line wrapper to the LOAD DATA INFILE sql statement, which can be used instead.

    If you need to reaorganize the data, you could just import the csv flat into an equivalent table, and from there, do insert ... select from

提交回复
热议问题