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.

www.it-ebooks.infoCHAPTER 27 • THE MANY MYSQL CLIENTS• Any options assigned via the command line override assignments located inconfiguration files or environment variables.• Options are case sensitive. For example, -p is representative of password, but -Pdenotes a port number.• When you pass options via the command line, they are prefaced with either onehyphen or two, depending upon whether you’re using the short or long form. Whenthey are passed in a configuration file, they are not prefaced with hyphens at all.Throughout this chapter, where applicable, both the short and long forms aresimultaneously introduced.• Some options require you to assign a value, and others provoke a certain behaviorsimply by being referenced. If an option requires a value, it will be noted when theoption is introduced.• If an option requires a value, and the option’s long form is used, you assign this valueby following the option with an equal sign and then the value. For example, if you’rereferencing the hostname option’s long form, you could assign www.example.com to it.For example:--host=www.example.com• When using the option’s short form, you assign a value by simply noting the valuedirectly after the option. You can include a space for readability, although you’re notconstrained to do so. For example:-h www.example.com• The only option that does not follow this format is the password option, the reason forwhich is explained in the next section.Connection OptionsThere are six commonly used connection options that you’ll likely consider using when starting a<strong>MySQL</strong> client. The long and short forms are listed here:• --host=name, -h: Specifies the target database host. If you’re connecting to thelocalhost, you can omit this option.• --password[=name], -p: Specifies the connecting user’s password. Although you caninclude the password on the command line, doing so is unadvisable because it couldbe logged to a command history file, causing a considerable security risk. Instead,upon execution, you’ll be prompted for the password, which will not be echoed backto the screen when you enter it. Regardless of which route you choose, keep in mindthat neither protects against password sniffing through <strong>net</strong>work monitoring when youconnect to a remote host because the password, along with all other connectioninformation, is transmitted unencrypted unless <strong>MySQL</strong>’s Secure Sockets Layer (SSL)capabilities are used. See Chapter 29 for more information about <strong>MySQL</strong>’s SSL feature.• --pipe, -W: Specifies that named pipes will be used to connect to the server.521

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

Saved successfully!

Ooh no, something went wrong!