Thursday, October 22, 2009

Chapter 9. Importing and Exporting Data











 < Day Day Up > 







Chapter 9. Importing and Exporting Data





This chapter covers the following exam topics:



  • The LOAD DATA INFILE statement

  • Using files on the server host and the client host

  • Limiting the columns and rows being imported

  • The SELECT INTO OUTFILE statement

  • Privileges needed for LOAD DATA INFILE and SELECT INTO OUTFILE



Questions on the material in this chapter make up approximately 5% of the exam.



MySQL includes two SQL statements that can be used to import data from files into your database or export data from your database into files:



  • LOAD DATA INFILE reads data records directly from a file and inserts them into a table.

  • SELECT … INTO OUTFILE writes the result of a SELECT statement to a file.



The two statements are related in the sense that they both transfer information between MySQL and datafiles. Also, both statements use similar syntax for describing the format of datafile contents.



The mysqlimport client provides another way to load datafiles into tables. It's a command-line interface to the LOAD DATA INFILE statement. It examines its arguments to determine what you want it to do, and then constructs appropriate LOAD DATA INFILE statements and executes them on your behalf. For more information about this program, see section 3.3, "Using mysqlimport."

















     < Day Day Up > 



    No comments:

    Post a Comment