Oracle 5.0 Reference Manual page 251

Table of Contents

Advertisement

Connections to remote servers always use TCP/IP. This command connects to the server running on
remote.example.com
shell>
mysql --host=remote.example.com
To specify a port number explicitly, use the
shell>
mysql --host=remote.example.com --port=13306
You can specify a port number for connections to a local server, too. However, as indicated previously,
connections to
localhost
connection as already described or any option that specifies a port number will be ignored.
For this command, the program uses a socket file on Unix and the
shell>
mysql --port=13306 --host=localhost
To cause the port number to be used, invoke the program in either of these ways:
shell>
mysql --port=13306 --host=127.0.0.1
shell>
mysql --port=13306 --protocol=TCP
The following list summarizes the options that can be used to control how client programs connect to
the server:
--host=host_name
The host where the server is running. The default value is localhost.
--password[=pass_val]
The password of the MySQL account. As described earlier, the password value is optional, but if
given, there must be no space between
The default is to send no password.
[231],
--pipe
-W
On Windows, connect to the server using a named pipe. The server must be started with the
enable-named-pipe
--port=port_num
The port number to use for the connection, for connections made using TCP/IP. The default port
number is 3306.
--protocol={TCP|SOCKET|PIPE|MEMORY}
This option explicitly specifies a protocol to use for connecting to the server. It is useful when the
other connection parameters normally would cause a protocol to be used other than the one you
want. For example, connections on Unix to
shell>
mysql --host=localhost
To force a TCP/IP connection to be used instead, specify a
shell>
mysql --host=localhost --protocol=TCP
The following table shows the permissible
platforms on which each value may be used. The values are not case sensitive.
--
[231 ]
protocol
Value
TCP
Connecting to the MySQL Server
using the default port number (3306):
--port
on Unix will use a socket file by default. You will need to force a TCP/IP
[231],
-h host_name
[231],
-p[pass_val]
or
-p
[407]
option to enable named-pipe connections.
[231],
-P port_num
localhost
--protocol
Connection Protocol
TCP/IP connection to local or remote server
231
[231]
or
option:
-P
--port
[231]
and the password following it.
--password=
[231]
are made using a Unix socket file by default:
--protocol
[231]
option values and indicates the
[231]
option is ignored:
--
[231]
option:
Permissible Operating
Systems
All

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents