Documentation Home
MySQL Utilities 1.5
Related Documentation Download this Manual
PDF (US Ltr) - 1.0Mb
PDF (A4) - 1.0Mb

MySQL Utilities 1.5  /  ...  /  Command-line Options Command-line Options

The least secure way to provide connection information for MySQL servers is to specify the data on the command-line. This is least secure because the data is visible on the command-line and is also visible in any log or redirection of the execution.

In this case, we specify the data in the following order: user[:passwd]@host[:port][:socket] where the passwd, port, and socket are optional. Each item is described in more detail below.

  • user

    The name of the user to connect.

  • passwd

    The password to use when connecting. The default if no password is supplied is the empty password.

  • host

    The domain name of the host or the IP address. This field accepts host names, and IPv4 and IPv6 addresses. It also accepts quoted values which are not validated and passed directly to the calling methods. This enables users to specify host names and IP addresses that are outside of the supported validation mechanisms.

  • port

    The port to use when connecting to the server. The default if no port is supplied is 3306 (which is the default port for the MySQL server as well).

  • unix_socket

    The socket to connect to (instead of using the host and port parameters).

The following demonstrates executing a utility using command-line options for connecting to a server.

shell> --server=root:other-pass@localhost:3308 --format=vertical
# Source on localhost: ... connected.
*************************       1. row *************************
server: localhost:13001
config_file: /etc/my.cnf, /etc/mysql/my.cnf
binary_log: clone-bin.000001
binary_log_pos: 341
version: 5.6.17-log
datadir: /Volumes/Source/source/temp_13001/
basedir: /Volumes/Source/source/git/mysql-5.6
plugin_dir: /Volumes/Source/source/git/mysql-5.6/lib/plugin/
general_log: OFF
slow_query_log: OFF
1 row.

As of MySQL Utilities 1.4.4, this deprecated connection method issues a warning if you use this connection method.

User Comments
Sign Up Login You must be logged in to post a comment.