metricsign
Start free
High severityauthentication

Power BI Refresh Error:
18456

What does this error mean?

Authentication failed — the provided credentials are invalid, the account is disabled, or the login has no access to the target database.

Common causes

  • 1Wrong username or password in the connection string (state 8)
  • 2The SQL login does not exist on the server (state 5)
  • 3The login exists but has no access to the specified database (state 16)

How to fix it

  1. 1Step 1: Find the exact state code in the SQL Server error log: SSMS → Management → SQL Server Logs, or run: EXEC xp_readerrorlog 0, 1, N'18456'. State 5 = invalid login, state 8 = wrong password, state 16 = no DB access.
  2. 2Step 2: Reset the password or re-enable the account: ALTER LOGIN [loginname] WITH PASSWORD = 'NewPass123!'; ALTER LOGIN [loginname] ENABLE;
  3. 3Step 3: If SQL auth is rejected entirely, verify the server auth mode: SSMS → right-click server → Properties → Security → set 'SQL Server and Windows Authentication mode', then restart SQL Server service.

Frequently asked questions

How do I find the 18456 state code?

Run EXEC xp_readerrorlog 0, 1, N'18456' in SSMS or check the SQL Server error log under Management. The state number after 'Login failed for user' gives the exact sub-reason.

Can SQL Server 18456 cause Power BI refresh failures?

Yes — if a dataset uses SQL Server with stored credentials, a password change causes 18456 on every scheduled refresh until you update the credentials in Power BI Service dataset settings.

What is 18456 state 38?

State 38 means the login is valid but the specified database does not exist. Check for a typo in the Initial Catalog connection string parameter.

Official documentation: https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-18456-database-engine-error

Other authentication errors