How to update a huge MySQL table from a text file

Posted on

Question :

I have a huge MySQL table with 1.3 TB data with InnoDB engine format.

Now I have a text file containing updated values of 2.2 GB of records in the 1.3 TB of data.

How do I proceed ?

I am a newbie to this data loading part. Please guide me through this.

Here the sample data present in the .txt file.

91653   8       2       1       4       Publisher                               2       1       4
91653   8       2       2       5       Publisher                               3b      1       5

Answer :

since you are using TSV file you can use the following command to import the data:

LOAD DATA INFILE 'data.tsv' INTO TABLE database_name.my_table;


Leave a Reply

Your email address will not be published. Required fields are marked *