Reputation: 7
I am new to MySQL and I searched internet. Before I used CSV file or SQL file to import my data into DB. But now I have a text file with this format:
number
989399999999
989388888888
989384444444
This continues about 300 records. How can I import this to my database?
Upvotes: 0
Views: 289
Reputation: 5358
The LOAD DATA INFILE statement reads rows from a text file into a table at a very high speed. The file name must be given as a literal string.
LOAD DATA LOCAL INFILE 'C:\\Users\\hi\\Desktop\\abc.txt' INTO TABLE customer LINES TERMINATED BY '\n' IGNORE 1 LINES
Query is self explanatory I hope :)
Upvotes: 1