11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 38 • IMPORTING AND EXPORTING DATAwww.it-ebooks.info• --lines-terminated-by=: This option determines how mysqlimport will recognizeeach separate line in the file. See the section “Importing Data with LOAD DATAINFILE” earlier in this chapter for a complete introduction.• --lock-tables, -l: This option write-locks all tables located in the target databasefor the duration of mysqlimport‘s execution.• --local, -L: This option specifies that the target file is located on the client. Bydefault, it is assumed that this file is located on the database server; therefore, youneed to include this option if you’re executing this command remotely and havenot uploaded the file to the server.• --low-priority: This option delays execution of mysqlimport until no other clientsare reading from the table.• --password=your_password, -pyour_password: This option is used to specify thepassword component of your authentication credentials. If the your_password partof this option is omitted, you will be prompted for the password.• --port, -P: If the target <strong>MySQL</strong> server is running on a nonstandard port (<strong>MySQL</strong>’sstandard port is 3306), you need to specify that port value with this option.• --replace, -r: This option causes mysqlimport to overwrite any rows located inthe target file that share the same primary or unique key as a row already locatedin the table.• --silent, -s: This option tells mysqlimport to output only error information.• --socket, -S: This option should be included if a nondefault socket file had beendeclared when the <strong>MySQL</strong> server was started.• --ssl: This option specifies that SSL should be used for the connection. Thiswould be used in conjunction with several other options that aren’t listed here.See Chapter 29 for more information about SSL and the various options used toconfigure this feature.• --user, -u: By default, mysqlimport compares the name/host combination of theexecuting system user to the mysql privilege tables, ensuring that the executinguser possesses adequate permissions to carry out the requested operation.Because it’s often useful to perform such procedures under the guise of anotheruser, you can specify the “user” component of credentials with this option.• --verbose, -v: This option causes mysqlimport to output a host of potentiallyuseful information pertinent to its behavior.• --version, -V: This option causes mysqlimport to output version information andexit.Taking into account some of these options, the following mysqlimport example illustrates a scenarioinvolving the update of inventory audit information residing on the workstation of a companyaccountant:%>mysqlimport -h intra<strong>net</strong>.example.com -u accounting -p --replace \> --compress --local company inventory.txt726

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!