Skip to main content

SQL Developer Access Denied - How to Fix

Getting "access denied", "authentication failed", or "login failed" errors? Here's how to troubleshoot and fix database permission issues.

Database security and authentication

What "Access Denied" Means

The connection worked, but login failed

Unlike "connection refused" (can't reach the server), "access denied" means SQL Developer successfully connected to the database server, but the server rejected your login. This happens when:

  • Wrong username or password
  • User doesn't exist
  • User isn't allowed to connect from your IP address
  • User lacks permission to access the specific database
  • Account is locked or expired

How to Fix It

Common causes and solutions

1

Check Username & Password

Passwords are case-sensitive. Double-check for typos, extra spaces, or copy-paste errors.

Try logging in with the same credentials using a different tool (command line, phpMyAdmin, etc.) to confirm they work.

2

Check Host Restrictions

Many database users are configured to only connect from specific hosts.

MySQL example:
A user created as 'john'@'localhost' can only connect locally. To connect remotely, you need 'john'@'%' or 'john'@'your-ip'.

3

Verify Database Privileges

Your user might exist but lack permission to access the specific database you're trying to connect to.

Ask your DBA to run:
SHOW GRANTS FOR 'username'@'host';

Database-Specific Fixes

Solutions for each database type

MySQL / MariaDB

Reset password and grant access:

ALTER USER 'username'@'%' IDENTIFIED BY 'newpassword'; GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'%'; FLUSH PRIVILEGES;

PostgreSQL

Check pg_hba.conf for host-based authentication rules. Add a line like:

host all username 0.0.0.0/0 md5

Then restart PostgreSQL.

Oracle

Check if the account is locked:

SELECT account_status FROM dba_users WHERE username = 'YOUR_USER'; -- If locked: ALTER USER your_user ACCOUNT UNLOCK;

Still Getting Access Denied?

Contact your database administrator - they can check the server logs for the exact reason your login failed.