Skip to main content

SQL Developer Connection Refused - How to Fix

Getting "connection refused" when trying to connect to your database? This guide covers the most common causes and how to fix them.

Database connection troubleshooting

What "Connection Refused" Means

Understanding the error helps you fix it faster

A "connection refused" error means SQL Developer tried to connect to your database server, but nothing responded. The server either:

  • Isn't running at all
  • Is running on a different port
  • Is blocked by a firewall
  • Is only accepting local connections

This is different from "access denied" (wrong password) or "unknown host" (wrong hostname). Connection refused specifically means the network connection itself failed.

How to Fix It

Try these solutions in order

1

Check if the Database is Running

Windows:
Open Services (Win+R, type services.msc). Look for your database service (e.g., "MySQL80", "postgresql-x64-14", "OracleServiceXE"). Make sure it says "Running".

Linux/Mac:
sudo systemctl status mysql
sudo systemctl status postgresql

2

Verify the Port Number

Make sure you're using the correct port in SQL Developer:

MySQL: 3306
PostgreSQL: 5432
Oracle: 1521
SQL Server: 1433
MariaDB: 3306

If your DBA changed the default port, ask them for the correct one.

3

Check Your Firewall

Firewalls often block database ports by default.

Windows Firewall:
Control Panel → Windows Defender Firewall → Allow an app → Add port exception

Cloud servers (AWS, Azure, GCP):
Check your Security Group / Network Security Group rules.

Test Your Connection

Use these commands to diagnose the issue

Test if you can reach the server:

ping your-database-server.com

Test if the port is open (Windows):

Test-NetConnection -ComputerName your-server.com -Port 3306

Test if the port is open (Mac/Linux):

nc -zv your-server.com 3306

If ping works but the port test fails, the database isn't accepting connections on that port (firewall issue or wrong port).

Still Having Issues?

If none of these solutions worked, contact your database administrator or reach out to us.