如何将excel数据导出到Mysql表中

时间:2021-01-12 01:45:50

How can we export Excel data into Mysql table. Is there any plugIn in excel for converting data into mysql table or in any other methods?

如何将Excel数据导出到Mysql表中。excel中是否有将数据转换成mysql表或其他方法的插件?

4 个解决方案

#1


0  

Convert your Excel to CSV first then import in phpmyadmin. The number of columns in csv should be equal to number of columns in table, If you have auto increment for first column then leave first column of CSV blank.

首先将您的Excel转换为CSV,然后在phpmyadmin中导入。csv中列的数量应该等于表中的列数,如果第一个列有自动增量,则将csv空白的第一列保留下来。

如何将excel数据导出到Mysql表中

IF you dont use phpmyadmin this or this will help you out with import.

如果您不使用phpmyadmin,这个或这个将帮助您进行导入。

#2


1  

You can read and write by this. and also store data to your sqlite database table from .xls files cell.

你可以这样读和写。还可以从.xls文件单元格将数据存储到sqlite数据库表中。

#3


0  

You need to save your data in CSV format(comma separated values) format in a file then you can use LOAD DATA command to load the data from file to table

需要将数据保存为CSV格式(逗号分隔值),然后可以使用LOAD data命令从文件加载到表

Example -

的例子,

LOAD DATA INFILE 'path_of_file' INTO TABLE 'name_of_table'

将“path_of_file”内的数据加载到表“name_of_table”中

more information on load data can be found in MySQL manuals available online

更多关于负载数据的信息可以在MySQL手册中找到

#4


0  

In case you convert Excel into CSV, then there is a way for bulk export:

如果您将Excel转换为CSV,则有一种批量导出的方法:

query = "LOAD DATA INFILE '"+"\\FileName.csv"+"' INTO TABLE Table_Name  FIELDS TERMINATED BY ',' (Column_Name,....)";

Make sure, you match the table columns with the file(.csv) columns, to avoid error.

确保将表列与文件(.csv)列相匹配,以避免错误。

#1


0  

Convert your Excel to CSV first then import in phpmyadmin. The number of columns in csv should be equal to number of columns in table, If you have auto increment for first column then leave first column of CSV blank.

首先将您的Excel转换为CSV,然后在phpmyadmin中导入。csv中列的数量应该等于表中的列数,如果第一个列有自动增量,则将csv空白的第一列保留下来。

如何将excel数据导出到Mysql表中

IF you dont use phpmyadmin this or this will help you out with import.

如果您不使用phpmyadmin,这个或这个将帮助您进行导入。

#2


1  

You can read and write by this. and also store data to your sqlite database table from .xls files cell.

你可以这样读和写。还可以从.xls文件单元格将数据存储到sqlite数据库表中。

#3


0  

You need to save your data in CSV format(comma separated values) format in a file then you can use LOAD DATA command to load the data from file to table

需要将数据保存为CSV格式(逗号分隔值),然后可以使用LOAD data命令从文件加载到表

Example -

的例子,

LOAD DATA INFILE 'path_of_file' INTO TABLE 'name_of_table'

将“path_of_file”内的数据加载到表“name_of_table”中

more information on load data can be found in MySQL manuals available online

更多关于负载数据的信息可以在MySQL手册中找到

#4


0  

In case you convert Excel into CSV, then there is a way for bulk export:

如果您将Excel转换为CSV,则有一种批量导出的方法:

query = "LOAD DATA INFILE '"+"\\FileName.csv"+"' INTO TABLE Table_Name  FIELDS TERMINATED BY ',' (Column_Name,....)";

Make sure, you match the table columns with the file(.csv) columns, to avoid error.

确保将表列与文件(.csv)列相匹配,以避免错误。