The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
If MySQL Workbench cannot connect to localhost, first confirm that a MySQL Server instance is installed and running. Then check that Workbench is using the same connection method and endpoint the server actually listens on. For Standard TCP/IP, that usually means the correct host and port; for a local socket or named pipe, it means the correct local path or pipe name. An “Access denied” error is a separate issue: the server responded, so check the account and authentication rather than changing the port.
What the error usually means
MySQL Workbench is a client, not the database server. Oracle’s Workbench connection tutorial says an instance of MySQL Server must be installed, started, and accessible before connecting. Installing Workbench alone does not provide a running local server.
The exact error is important. “Connection refused” or “Can’t connect” usually points to an unavailable or mismatched endpoint, a server that is not listening for the selected transport, or a firewall. “Access denied” means the server answered but rejected the account or authentication. A socket-file error points to a local socket path that Workbench cannot use.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Start with the full error and server status
- Record the complete error text and code. Note whether it says connection refused, names a socket file, or says “Access denied.” These indicate different troubleshooting paths.
- Confirm that MySQL Server is installed. Workbench’s connection setup cannot connect to a server that is absent. If only Workbench was installed, install a MySQL Server instance first.
- Check that the server is running. Use the service or process controls appropriate to your operating system and installation method. Workbench can show or manage server status when a suitable system profile is configured, but a saved connection by itself does not start a server. See the Workbench system profile documentation.
Check the connection method and endpoint
Open the saved connection in Workbench and verify its connection method. The values must match how the server is configured; changing a setting to a common default will not help if the server uses a different endpoint.
#1 Best Overall
Standard TCP/IP
For Standard TCP/IP, check the hostname or IP address and port. Workbench documents 3306 as the default TCP/IP port, but a local installation may use another port. Use the port configured for the running server, not an assumed default. See Workbench’s Standard TCP/IP connection documentation.
If localhost fails, try 127.0.0.1 as a diagnostic comparison. This is not a universal fix: localhost may resolve to IPv4 loopback (127.0.0.1) or IPv6 loopback (::1). Which address works can depend on the server listener and account host permissions. Oracle documents this name-resolution detail in its Standard TCP/IP connection guidance.
Rank #2
Local socket or named pipe
A local socket or named pipe is a different transport from TCP/IP. Workbench documents /tmp/mysql.sock as the Unix socket default and MySQL as the Windows named-pipe default; the actual path or name can differ with the server’s installation and configuration. Check the server’s configured endpoint and enter that exact value in Workbench. See Workbench’s Local Socket/Pipe connection documentation.
| Connection method | What to match | What must be available |
|---|---|---|
| Standard TCP/IP | Server hostname or IP address and TCP/IP port | The server must listen for TCP/IP connections on that address and port. |
| Local socket or pipe | Unix socket file path or Windows pipe name | The server must provide that local endpoint, and Workbench must use its configured path or name. |
If TCP/IP connections are refused
When the server is running but a TCP/IP attempt is refused, check whether it is listening on the endpoint Workbench is using. MySQL’s troubleshooting documentation notes that skip_networking disables TCP/IP connections. The bind_address setting can also limit which addresses accept connections; for example, bind_address=127.0.0.1 restricts listening to IPv4 loopback. A firewall rule may also block the port. See MySQL 8.0’s connection troubleshooting guidance and Troubleshooting Problems Connecting to MySQL.
- Confirm Workbench’s host and port match the server’s listener.
- Check whether TCP/IP networking is disabled or the server is bound to a different address.
- Check firewall rules for the configured port.
The cited troubleshooting pages are for MySQL 8.0; setting names and behavior should be checked against the version installed on your system.
If the server says “Access denied”
Do not keep changing ports after receiving “Access denied.” That response indicates the server was reached, but it rejected the supplied credentials or account. Verify the username, password, authentication configuration, and the account’s permitted host. This matters when testing localhost against 127.0.0.1 or ::1, because the address used can affect which host permission applies. MySQL’s connection troubleshooting documentation covers account and connection failures.
Test the saved connection in Workbench
After checking the server state and endpoint, use Workbench’s Test Connection control for the saved connection. Read the resulting error and any encryption details; change connection parameters only when they match the server’s actual configuration. The connection setup steps are described in Creating a New MySQL Connection.
If the failure persists, the details needed to narrow it down are the operating system, MySQL Server and Workbench versions, installation method, selected connection method, configured port or socket/pipe, and the full error message.
Quick Recap
Best Value
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.

