Home > Database > Mysql Tutorial > How to import txt data in mysql?

How to import txt data in mysql?

黄舟
Release: 2017-08-11 14:40:12
Original
2884 people have browsed it

For a large amount of data that cannot be simply inserted using the insert statement, you need to use a specific load statement to load the data in the txt document.


1. First use navicat to create a table in the mysql database (note that it corresponds to the columns of the txt data), the database and The txt file is as shown below

How to import txt data in mysql?

How to import txt data in mysql?

##2. Find the MySQL Command Line Client and open it

How to import txt data in mysql?

How to import txt data in mysql?


#3. Enter the password to enter mysql and select the database where the table is located: use database name

How to import txt data in mysql?


##4. Enter the code to load txt data:

load data infile 'absolute file' into table table name, and then the data is imported.

How to import txt data in mysql?

How to import txt data in mysql?

#InstructionsNote that the columns of the txt file and the table must be consistent

The above is the detailed content of How to import txt data in mysql?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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