Hi,, am working on project which deals with bulk data upload into database by using CSV file. Is there any easy way or packages to handle situation like that?
sqlyog, and others like it. I believe phpadmin also, but not sure.
If using MySQL I would probably do this in a raw query using LOAD DATA LOCAL INFILE
Since you mentioned bulk data, I think it's better not to rely on any packages but the original tools your DBMS provided.
MySQL http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html
mysqlimport --ignore-lines=1 --fields-terminated-by=,
--columns='ID,Name,Phone,Address' --local -u root -p
Database /path/to/csvfile/TableName.csv
MongoDB http://docs.mongodb.org/manual/reference/program/mongoimport/
#Mongo one is straight forward. Something like
mongoimport -h localhost -p 27017 -d mydb --type csv --file your_csv.csv -c your_collection --headerline
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community