Category Archives: MySQL

Inserting Data from a text file to MySQL Table

  • Each column must be tab separated
  • Each row must be a new line
  • Total number of columns in file should be equal to total number of columns in text file to avoid ambiguity

Step 1: Copy the file to local folder of MySQL Machine (root) folder)

Step 2:  Run following command on MySQL interface:

load data local infile “filename” into table data_table; 

Reference: http://forums.mysql.com/read.php?10,155114,155141