2. Is the server running Try running the command mysqladmin status from a terminal window or command prompt. If connecting
to a server on localhost, do you have filesystem access to the socket file The socket file is normally created as
/tmp/mysql.sock but can be created in any location specified when the server was started. If it’s created in a directory that some users can’t access—for example, in the MySQL server’s data directory—
these users won’t be able to connect to the server. For the MySQL command-line tools, use the socket option to specify a custom socket path. If connecting to a server
on a host other than localhost, is the server running on a port other than 3306? You should specify the same port to the client as the one you specified when starting your server if you don’t administer the server, ask the system administrator to tell you the correct port number. For
the MySQL com- mand-line tools, use the port option to specify a custom port number. If connecting to a server on a host other than localhost
, is it configured to accept network connections Ensure that the server was not started with the skip-net working option on the command line or in an options file (we discuss options files in Chapter 11).
6. If connecting to a server on a host other than localhost
, is a firewall preventing network connections Firewall software or hardware maybe preventing connections to the port on which MySQL listens for incoming connections (the default port is 3306).
To fix this, you need to modify the firewall so that connections on this port are allowed. Firewalls vary between networks and platforms, and you’ll need to refer to your documentation or discuss with your system administrator how to make these changes to your network or host-based firewall. Any firewall changes should be considered carefully to balance feature and security requirements.
Share with your friends: