Home > Database > Mysql Tutorial > How to Import a Large Tab-Delimited Text File into MySQL Using LOAD DATA INFILE?

How to Import a Large Tab-Delimited Text File into MySQL Using LOAD DATA INFILE?

DDD
Release: 2024-12-23 04:05:14
Original
217 people have browsed it

How to Import a Large Tab-Delimited Text File into MySQL Using LOAD DATA INFILE?

Importing Data from Text File into MySQL Database Using LOAD DATA INFILE

Q: How can I import 350MB of tab-delimited data from a text file into a MySQL database table named PerformanceReport in the Xml_Date database?

A: To import this text file data into MySQL, you can use the LOAD DATA INFILE command:

LOAD DATA INFILE '/path/to/text_file.txt' INTO TABLE PerformanceReport;
Copy after login

Make sure to replace '/path/to/text_file.txt' with the actual path to your text file.

By default, LOAD DATA INFILE assumes that the data in your text file is tab-delimited and has one row per line. Therefore, it should import the data from your text file without any issues.

Here's a breakdown of the different parts of the command:

  • LOAD DATA INFILE: This is the command that starts the data import process.
  • '/path/to/text_file.txt': This is the path to your text file.
  • INTO TABLE PerformanceReport: This specifies the name of the MySQL table where you want to import the data.

The above is the detailed content of How to Import a Large Tab-Delimited Text File into MySQL Using LOAD DATA INFILE?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template