Specifies the address or addresses of the database server.
{ Host | IP }=ip-address
TCP/IP (client side only)
ip-address This string must be specified in the form of an IP address and it can optionally include a port number (separated by a colon). The list of host values is a comma-separated list. For IPv6 addresses that include a port number, you must enclose the address in either square brackets or parentheses You can use localhost to identify the current computer. For example:
links=tcpip(HOST=myhost) links=tcpip(HOST=myhost:1234) links=tcpip(HOST=10.25.13.5,myotherhost) links=tcpip(HOST=myhost:1234,10.25.65.112) links=tcpip(HOST=myhost:1234,myotherhost:5678) |
Search the current TCP/IP subnet.
The HOST protocol option is different from the Host connection parameter. The HOST protocol option is used with the CommLinks connection parameter. You should only use the CommLinks (LINKS) connection parameter if you need to specify TCP/IP options other than HOST or ServerPort (PORT). You cannot specify both CommLinks and Host in the connection string. See CommLinks (LINKS) connection parameter.
In most cases, you should use the Host connection parameter. See Host connection parameter.
HOST specifies the address or addresses of the database server. IP and HOST are synonyms. You can use a comma-separated list
of addresses to search for more than one computer. You can also append a port number to an IP address, using a colon as separator.
Alternatively, you can specify the host and server ports explicitly using the SeverPort protocol option, as in HOST=myhost;PORT=5000
. For IPv6 addresses that include a port number, you must enclose the address in either square brackets or parentheses, for
example [fe80::5445:5245:444f]:2638
. If a port is specified, only that port number is used for TCP/IP connections and UDP broadcasts. If a port number is not
specified, port 2638 is used.
Because the host name is required, but the port number and the ServerName connection parameter are optional, there are four possible combinations:
Host connection parameter | Description | Equivalent CommLinks (LINKS) connection parameter connection string | ||||
---|---|---|---|---|---|---|
|
Attempts to connect to a database server running on serverhost port 1234. |
|
||||
|
Attempts to connect to a database server named myserver running on serverhost port 1234. |
|
||||
|
Attempts to connect to a database server running on serverhost on the default port, 2638. |
|
||||
|
Attempts to connect to a database server named myserver running on serverhost on any port. For limitations, see ServerPort (PORT) protocol option. |
|
When specifying an IPv6 address on a Windows platform, the interface identifier should be used. Unix platforms support both interface identifiers and interface names in IPv6 addresses. The interface identifier is required on Linux (kernel 2.6.13 and later).
Use the -z option to have the database server print address information to the database server messages window during startup.
Specify the LogFile connection parameter to have the client application write the addressing information to its log file.
You cannot specify the LocalOnly protocol option with the HOST protocol option or the Host connection parameter.
The following connection string fragment instructs the client to look on the computers kangaroo and 197.75.209.222 (port 2369) to find a database server:
LINKS=tcpip(IP=kangaroo,197.75.209.222:2369) |
The following connection string fragment instructs the client to look on the computers my-server and kangaroo to find a database server.
LINKS=tcpip(HOST=my-server,kangaroo;PORT=2639) |
The following connection string fragment instructs the client to look for a database server on host1 running on port 1234 and for a database server on host2 running on port 4567. The client does not look on host1 on port 4567 or on host2 on port 1234.
LINKS=tcpip(HOST=host1:1234,host2:4567) |
The following connection string fragment instructs the client to look for a database server on an IPv6 address:
LINKS=tcpip(HOST=fe80::5445:5245:444f) |
The following connection string fragment instructs the client to look for a database server on an IPv6 address on port 2639:
LINKS=tcpip(HOST=[fe80::5445:5245:444f]:2639) |
The following examples demonstrate using IPv6 addresses with the HOST protocol option:
// Global scope address, unique everywhere, so no interface index is required // no index required -c "links=tcpip(host=fd77:55d:59d9:56a:202:55ff:fe76:df19)" // all communication is done through interface 2 -c "links=tcpip(host=fd77:55d:59d9:56a:202:55ff:fe76:df19%2)" // all communication is done through eth0 -c "links=tcpip(host=fd77:55d:59d9:56a:202:55ff:fe76:df19%eth0)" // Link scope address, addresses are unique on each interface // possibly ambiguous (this host may exist through both eth0 and eth1) -c "links=tcpip(host=fe80::202:55ff:fe76:df19)" // not ambiguous because it must use interface 2 -c "links=tcpip(host=fe80::202:55ff:fe76:df19%2)" // not ambiguous because it must use eth0 -c "links=tcpip(host=fe80::202:55ff:fe76:df19%eth0)" |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |