MySQL Text File Import and batch processing mode application description

Source: Internet
Author: User
Tags mysql text table definition
MySQL Text File Import and batch processing mode application instructions. For more information, see.

MySQL Text File Import and batch processing mode application instructions. For more information, see.

1. Load records in text files into mysql database tables
(1) Text File Format: one record per line. The field values are separated by the tab operator. The field order is the same as the order in the table definition. The uncertain field values are represented by \ N;
(2) load data local infile 'pet.txt 'into table pet;
Note: If the windows Editor is used, use:
Load data local infile 'pet.txt 'into table pet
Lines terminated by '\ r \ n ';

Run mysql in 2 mode
(1 put the mysqlsyntax to be run in a batch file batch-file.txt;
(2) Execution: mysql-h host-u user-p <batch-file.txt;
(3.txt redirects the output to the out.txt file:
Mysql-h host-u user-p <batch-file.txt> out.txt;
Run the script from the mysql prompt:
Mysql> source batch-file.txt; or mysql> \. batch-file.txt;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.