I have a table mileage_registrants
which keeps users registration 开发者_JAVA百科data. It has a field department
which is NULL
for all users now. I want to insert department data from a .xlsx
file into table department
. There are one thousand records so it is horrible for me to insert them by hand.
Is there anyway for me to get this done quickly?
Assuming you have access to PhpMyAdmin, you may want to export your xlsx to CSV format, then import it using PhpMyAdmin import tool.
Beware of the encoding though!
you can do it via excel itselfe.
Here you can find a quick tutorials of you to interact with excel from mysql
http://www.heritage-tech.net/908/inserting-data-into-mysql-from-excel-using-vba/
http://www.heritage-tech.net/267/interfacing-with-mysql-via-excel/
http://blog.tjitjing.com/index.php/2008/02/import-excel-data-into-mysql-in-5-easy.html
It is highly recommended to do a dry run before running on production
精彩评论