Spec-Zone .ru
спецификации, руководства, описания, API
|
The MySQL server listens on a single network socket for TCP/IP connections. This socket is bound to a single
address, but it is possible for an address to map onto multiple network interfaces. To specify an address, use
the --bind-address=
option at server startup, where addr
addr
is an IPv4 or IPv6 address or a host name. (IPv6 addresses
are not supported before MySQL 5.5.3.) If addr
is a host name, the
server resolves the name to an IP address and binds to that address.
The server treats different types of addresses as follows:
If the address is *
, the server accepts TCP/IP
connections on all server host IPv6 and IPv4 interfaces if the server host supports IPv6, or accepts
TCP/IP connections on all IPv4 addresses otherwise. Use this address to permit both IPv4 and IPv6
connections on all server interfaces. This value is permitted (and is the default) as of MySQL 5.6.6.
If the address is 0.0.0.0
, the server accepts TCP/IP
connections on all server host IPv4 interfaces. This is the default before MySQL 5.6.6.
If the address is ::
, the server accepts TCP/IP
connections on all server host IPv4 and IPv6 interfaces. Use this address to permit both IPv4 and IPv6
connections on all server interfaces.
If the address is an IPv4-mapped address, the server accepts TCP/IP connections for
that address, in either IPv4 or IPv6 format. For example, if the server is bound to ::ffff:127.0.0.1
, clients can connect using --host=127.0.0.1
or --host=::ffff:127.0.0.1
.
If the address is a "regular"
IPv4 or IPv6 address (such as 127.0.0.1
or ::1
),
the server accepts TCP/IP connections only for that IPv4 or IPv6 address.
If you intend to bind the server to a specific address, be sure that the mysql.user
grant table contains an account with administrative privileges that you can use to connect to that address.
Otherwise, you will not be able to shut down the server. For example, if you bind the server to *
, you can connect to it using all existing accounts. But if you bind the server
to ::1
, it accepts connections only on that address. In that case, first make sure
that the 'root'@'::1'
account is present in the mysql.user
table so you can still connect to the server to shut it down.