Common Errors When Using MySQL Programs
2948
really exists. The fix in this case is to change the
cron
job to not remove
mysql.sock
or to place
the socket file somewhere else. See
Section C.5.4.5, “How to Protect or Change the MySQL Unix
Socket File”
.
• You have started the
mysqld
server with the
--socket=/path/to/socket
[422]
option, but
forgotten to tell client programs the new name of the socket file. If you change the socket path
name for the server, you must also notify the MySQL clients. You can do this by providing the same
--socket
[232]
option when you run client programs. You also need to ensure that clients have
permission to access the
mysql.sock
file. To find out where the socket file is, you can do:
shell>
netstat -ln | grep mysql
See
Section C.5.4.5, “How to Protect or Change the MySQL Unix Socket File”
.
• You are using Linux and one server thread has died (dumped core). In this case, you must kill the
other
mysqld
threads (for example, with
kill
or with the
mysql_zap
script) before you can restart
the MySQL server. See
Section C.5.4.2, “What to Do If MySQL Keeps Crashing”
.
• The server or client program might not have the proper access privileges for the directory that holds
the Unix socket file or the socket file itself. In this case, you must either change the access privileges
for the directory or socket file so that the server and clients can access them, or restart
mysqld
with
a
--socket
[422]
option that specifies a socket file name in a directory where the server can create
it and where client programs can access it.
If you get the error message
Can't connect to MySQL server on some_host
, you can try the
following things to find out what the problem is:
• Check whether the server is running on that host by executing
telnet some_host 3306
and
pressing the Enter key a couple of times. (3306 is the default MySQL port number. Change the value
if your server is listening to a different port.) If there is a MySQL server running and listening to the
port, you should get a response that includes the server's version number. If you get an error such as
telnet: Unable to connect to remote host: Connection refused
, then there is no
server running on the given port.
• If the server is running on the local host, try using
mysqladmin -h localhost variables
to
connect using the Unix socket file. Verify the TCP/IP port number that the server is configured to
listen to (it is the value of the
port
[482]
variable.)
• If you are running under Linux and Security-Enhanced Linux (SELinux) is enabled, make sure you
have disabled SELinux protection for the
mysqld
process.
C.5.2.2.1.
Connection to MySQL Server Failing on Windows
When you're running a MySQL server on Windows with many TCP/IP connections to it, and you're
experiencing that quite often your clients get a
Can't connect to MySQL server
error, the
reason might be that Windows does not allow for enough ephemeral (short-lived) ports to serve those
connections.
The purpose of
TIME_WAIT
is to keep a connection accepting packets even after the connection has
been closed. This is because Internet routing can cause a packet to take a slow route to its destination
and it may arrive after both sides have agreed to close. If the port is in use for a new connection, that
packet from the old connection could break the protocol or compromise personal information from the
original connection. The
TIME_WAIT
delay prevents this by ensuring that the port cannot be reused
until after some time has been permitted for those delayed packets to arrive.
It is safe to reduce
TIME_WAIT
greatly on LAN connections because there is little chance of packets
arriving at very long delays, as they could through the Internet with its comparatively large distances
and latencies.
Windows permits ephemeral (short-lived) TCP ports to the user. After any port is closed it will remain
in a
TIME_WAIT
status for 120 seconds. The port will not be available again until this time expires. The
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...