Operational Development Tips

Source: Internet
Author: User
Tags mysql import

Get the data from the shell script, then import it into the database, and implement the page experience with PHP code

  1. Write a shell script to get the appropriate information

  2. Via load data infile ' filename ' into table tablename; Import the resulting information into the database

    Specific parameters see the specific use of note load data

  3. Use PHP code to reflect the information you need on the page

Note: MySQL import information

Load data infile ' filename ' into table tablename [option]

Option parameter

Fields terminated by ' string '//field delimiter, default = ' \ t '

fields [optionally] enclosed by ' char '//field reference, if add optionally only on type Char,varchar,text and so on, default does not use

Fileds escaped by ' char '//escape character, default \

Lines starting by ' string '//before each line by adding the character '

Lines terminated by ' string '//Row not added by default \ n

Ignore number lines//number represents numbers, ignoring the first few lines of imported data

Set column name =exp//Convert a column before loading


Operational Development Tips

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.