Bulk loading into MySQLPosted: June 6, 2011
Mysql bulk loadint is pretty cool to, the reference for this can be found here, as always though I just want the bit to get t working.
I am using Linux Centos 5.6 mysql version ?????
The text file needs to be stored in the schema directory, in this example I am uploading to the pentaho schema and therefore my path is /u10/mysql/pentaho/
The command is therefore as follows
mysql -e schema_name -e “load data infile ‘name_of _file_to_import‘ into mysql_table fields terminated by ‘delimiter‘ ingnore number of lines lines”
The ignore number of lines is only needed if there is a header etc…
mysql pentaho -e “load data infile ‘fact_sales_history_statistics.txt’ replace into table fact_sales_history_statistics fields terminated by ‘;’ ignore 1 lines”