Error 10061 is a refused TCP connection, not a bad-password message. Your client reached the requested network endpoint, but no MySQL server accepted the connection. Check the mysqld service first, then verify the host and port, force a TCP test, inspect MySQL’s network settings, and finally check firewalls. MySQL documents this condition as ERROR 2003, “Can’t connect to MySQL server on ‘server’ (10061),” which indicates that the network connection was refused (MySQL 8.0 Reference Manual).
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
The sequence below works for a local development database, a game server database on another machine, and command-line diagnostics. It also explains when a Unix socket, skip_networking, bind_address, or an authentication rule is the real issue.
As an Amazon Associate I earn from qualifying purchases.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsWhat error 10061 actually tells you
10061 is reported at the transport stage. The MySQL client attempted a TCP connection to a host and port, but the operating system refused it. At that point, MySQL has not yet evaluated the username, password, database privileges, or SQL statement.
The refusal normally has one of these causes:
- The
mysqldserver process is stopped, crashed, or failed to start. - The client is using the wrong hostname, IP address, or TCP port.
- MySQL TCP networking is disabled with
skip_networking. - MySQL is listening only on loopback, commonly through
bind_address=127.0.0.1, while the client is remote. - A host or network firewall blocks the MySQL process or its configured port.
MySQL’s connection troubleshooting guidance starts by checking the server process and then the connection endpoint (Troubleshooting Problems Connecting to MySQL). Treat the number as a routing and service-state clue, not as evidence that credentials are wrong.
#1 Best Overall
Fastest diagnostic path
Run these checks in order. Stop when one identifies the fault, correct it, and retry the same connection.
| Check | What to do | What the result means |
|---|---|---|
| Server process | Verify that the MySQL service is running on the machine that should accept the connection. | If it is stopped or failed, no client can connect until it starts successfully. |
| Endpoint | Confirm the exact hostname or IP and the configured TCP port. Use the client’s --port option when the port is not the default. |
A wrong endpoint sends the client to a machine or listener that is not MySQL. |
| Forced TCP | For a local test, connect with -h 127.0.0.1. For a reachability test, try telnet some_host 3306 with the real host and port. |
This separates TCP problems from local socket or name-resolution behavior. |
| MySQL network settings | Inspect skip_networking and bind_address. |
Disabled TCP or loopback-only listening explains many remote refusals. |
| Firewall | Review rules on the database host and any network firewall for the actual MySQL process and port. | A rule for 3306 does not help if MySQL is configured for another port. |
1. Verify that mysqld is running
Start with the database host, not the client computer. A local client and a remote client can both receive 10061 when the server process is down.
On Windows
- Open the Windows Services console by running
services.msc. - Find the installed MySQL service. The displayed name varies by installation and version.
- Check its status. If it is stopped, choose Start. If it starts and immediately stops, inspect the MySQL error log before attempting network changes.
- Retry the original client command after the service remains running.
On Linux or another Unix-like host
- Use the operating system’s service manager to inspect the MySQL service status. Installations may register the unit as
mysql,mysqld, or another distribution-specific name. - Start the service through that manager if it is inactive.
- If startup fails, correct the startup error first; a firewall rule cannot make a failed server accept connections.
- Retry from the same client and endpoint used before.
Do not assume that a MySQL configuration file exists in the location used by another installation. The service’s own startup configuration and error log are the authoritative places to determine which instance is running and which configuration it loaded.
2. Confirm the host and TCP port
The client must target the address where MySQL is listening. Check the hostname or IP in the connection string, launcher configuration, environment variable, or application settings. A typo, an old private IP, or a hostname resolving to a different machine can all produce a refusal.
MySQL uses TCP port 3306 by default, according to the current MySQL Reference Manual, but administrators can change it. Treat 3306 as a default rather than a guarantee. Find the configured port in the server configuration or the administrator’s deployment documentation, then pass that value explicitly:
Rank #2
mysql --host=127.0.0.1 --port=3306 -u your_user -p
Replace both the host and port with the real endpoint. For a remote server, an example is:
mysql --host=db.example.internal --port=3307 -u your_user -p
The command examples show syntax, not credentials. Never paste a production password into a command that will be stored in shell history or shared logs.
3. Force a deliberate TCP test
“localhost” can select a local Unix socket or another platform-specific local transport instead of TCP. To test the network path itself, use the numeric loopback address:
mysql -h 127.0.0.1 -P 3306 -u your_user -p
If this works while a command using localhost fails, the server may be reachable but the local socket or name-resolution choice is wrong. Keep using the transport your application is configured to require, and correct that configuration rather than treating the password as the cause.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Probe the port without authenticating
MySQL’s troubleshooting manual documents Telnet as a basic reachability test:
telnet some_host 3306
Substitute the actual database host and configured port. A successful TCP opening shows that something accepted the socket; it does not prove that MySQL authentication will succeed. If the connection cannot be opened, continue with the service, listening-address, port, and firewall checks.
Ask MySQL utilities for a response
When the endpoint is expected to be reachable, these utilities can help identify whether a server is responding and expose configuration values:
mysqladmin --host=127.0.0.1 --port=3306 versionrequests the server version response.mysqladmin --host=127.0.0.1 --port=3306 variablesdisplays server variables that can help confirm the active configuration.
Use the same host and port that the failing application uses. Testing a different endpoint can create a false success.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute4. Inspect MySQL’s TCP settings
Check for skip_networking
If skip_networking is enabled, MySQL accepts no TCP/IP connections. Local clients may still work through a Unix socket, which can make the server appear healthy while every TCP client receives 10061.
Use the installation’s configuration inspection procedure or mysqladmin variables from a working local connection to determine whether TCP networking is disabled. Remove or disable skip_networking only when TCP access is required, then restart or reload MySQL according to that installation’s procedure. Retest with -h 127.0.0.1 before testing from another machine.
Check bind_address
A setting such as bind_address=127.0.0.1 makes MySQL listen only on the server’s loopback interface. Local connections can succeed, while a game server, admin tool, or other client on another machine is refused because MySQL is not listening on the server’s network interface.
If remote access is intentional, configure a listening address that includes the required interface or addresses, following your organization’s network policy. Do not broaden listening exposure merely to make an error disappear. After changing the setting, restart or reload MySQL as required by the installation and verify the resulting value with mysqladmin variables.
Recommended Free Tools
5. Check firewalls on the complete path
Inspect the database host’s operating-system firewall, any cloud or hypervisor firewall, and network firewalls between the client and server. Rules may be written for either the MySQL executable or a TCP port. Check both against the port MySQL is actually configured to use.
- On Windows, review inbound rules in Windows Firewall for the MySQL service or its configured TCP port.
- On Unix-like systems, review the host firewall and any service that manages packet filtering.
- For hosted or segmented networks, verify that the network policy allows the client’s source address to reach the database host and port.
Prefer a narrowly scoped rule for the known application or client network. Opening a database port to every address is not a safe substitute for identifying the correct source and destination. If a firewall change is made, rerun the same TCP probe and MySQL command so that only one variable changes at a time.
Best Value
Local connection versus remote connection
| Situation | Transport to verify | Most relevant checks |
|---|---|---|
| Client and MySQL on one machine | Unix socket or TCP loopback | Service state, -h 127.0.0.1, local port, and skip_networking. |
| Client on another machine | TCP over the network | Server’s listening address, configured port, route, and every firewall in the path. |
| Local socket command succeeds but TCP fails | Socket works; TCP path does not | Check skip_networking, port selection, and the loopback listener. |
| Local TCP works but remote TCP fails | MySQL accepts loopback only or the network path is blocked | Check bind_address, host and network firewalls, and the remote endpoint. |
This distinction prevents a common misdiagnosis: a successful local socket login does not prove that a remote TCP client can reach MySQL.
Do not treat 10061 as an authentication error
An authentication failure is reported after the server accepts the network connection. Messages such as “Access denied” indicate that MySQL was reached and then rejected the account, password, host authorization, or privileges. Error 10061 occurs earlier, when the TCP socket is refused.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →| Message category | Stage | Correct next step |
|---|---|---|
| Can’t connect … (10061) | Transport connection refused | Check service, endpoint, listener, TCP settings, and firewall. |
| Access denied for user | Server reached; authentication or authorization failed | Check account name, password, allowed host, and privileges. |
Changing a password, granting a database privilege, or editing an account host pattern will not make a refused TCP socket start accepting connections. Resolve the transport problem first, then address any authentication message that appears afterward.
Recovery branches for common symptoms
“It worked yesterday, and now localhost returns 10061”
- Check whether the MySQL service is still running after a reboot, update, crash, or configuration change.
- Confirm that the application still targets the same port.
- Force TCP with
-h 127.0.0.1and the configured port. - If only socket connections work, inspect
skip_networkingand the active MySQL configuration.
“Local tools connect, but a remote game server cannot”
- Confirm the remote client is using the database host’s reachable IP or DNS name, not
localhostor127.0.0.1. Those addresses refer to the remote client itself. - Verify that MySQL is not bound only to
127.0.0.1. - Confirm the configured port and allow that port from the remote client’s network through host and network firewalls.
- Use
telnet some_host portfrom the remote machine, then retry the MySQL client with the same endpoint.
“The port probe reaches something, but the MySQL client fails”
- Confirm that the probe used the same hostname and port as the client.
- Check whether another service, rather than MySQL, is listening on that port.
- Retry with
mysqladmin versionand inspect the returned error. If the server is reached and the error changes to authentication or authorization, move to account troubleshooting.
“Changing the firewall rule had no effect”
- Verify the rule’s port matches MySQL’s configured port, not simply the 3306 default.
- Check for a second firewall on the host, router, cloud network, or segmented subnet.
- Confirm that MySQL is actually listening on the expected interface; a firewall cannot fix a listener bound only to loopback.
Verify the repair without guessing
- Record the exact host and port used by the application.
- Confirm the MySQL service remains running after any restart.
- Run a TCP test with
-h 127.0.0.1for local connections or the real server address for remote connections. - Use
mysqladmin versionor a normal MySQL client login to verify that the server responds. - Only after transport succeeds, resolve any new “Access denied” or privilege message.
A successful repair is reproducible: the same endpoint accepts a TCP connection from the same client, and the application uses that endpoint rather than an undocumented default. Keep the configured port and listening-address decision in the deployment documentation so a restart or migration does not silently send clients back to 3306 or loopback.
Quick Recap
Command reference
| Purpose | Command pattern | Use it when |
|---|---|---|
| Force local TCP | mysql -h 127.0.0.1 -P 3306 -u your_user -p |
You need to avoid a socket or ambiguous localhost behavior. |
| Test raw reachability | telnet some_host 3306 |
You want to test whether the host and port accept a TCP opening. |
| Request a server response | mysqladmin --host=some_host --port=3306 version |
You need to distinguish a responding MySQL endpoint from a refused connection. |
| Inspect variables | mysqladmin --host=some_host --port=3306 variables |
You need to verify active network-related settings from a working connection. |
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




