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:
where the passwd, port, and socket are optional. Each item is
described in more detail below.
The name of the user to connect.
The password to use when connecting. The default if no password is supplied is the empty password.
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.
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).
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> mysqlserverinfo.py --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 relay_log: relay_log_pos: 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 general_log_file: general_log_file_size: log_error: log_error_file_size: slow_query_log: OFF slow_query_log_file: slow_query_log_file_size: 1 row. #...done.
As of MySQL Utilities 1.4.4, this deprecated connection method issues a warning if you use this connection method.