SQL Server error 18456: Login failed for user
SQL Server rejected the login attempt. A typical server message is:
Login failed for user 'docs_user'.The error number is 18456. It identifies an authentication failure, which can involve the account, authentication mode or requested database.
Common causes of SQL Server error 18456
Section titled “Common causes of SQL Server error 18456”Check these in order:
- Incorrect SQL user or password.
- The right credentials sent to the wrong server or instance.
- A disabled login or a password that requires attention.
- SQL authentication disabled on the server.
- A database the user cannot open, including an unavailable default database.
Microsoft’s 18456 reference explains the server-side causes. Ask an administrator to read the SQL Server error log for the detailed reason and state.
Local server or company server
Section titled “Local server or company server”Check Host, Port, Database and SQL User against the intended instance. Re-enter the password if it changed after you saved the connection.
Ask the administrator to confirm that the login is enabled, SQL authentication is permitted and the login has access to the requested database. If the default database is unavailable, enter an accessible database explicitly in Database.
Use the local connection guide to check the form. Send an administrator the server, port, database, user, error text and attempt time. Never send the password.
Docker
Section titled “Docker”Confirm that Port reaches the intended container, especially when several instances run on one host. The Docker guide explains published ports and reused-volume credentials.
Azure SQL Database
Section titled “Azure SQL Database”Enter the target database explicitly and use the SQL user configured for it. Ask the database administrator to confirm the user’s access to that database.
If the message says the client IP is not allowed, check the Azure network settings instead.
How TableAI shows the error
Section titled “How TableAI shows the error”TableAI identifies server error 18456 as Authentication Failed and suggests checking the SQL login and password. Open the error details to read the available database message and code before changing settings.
A failed connection test can also report:
SQL Server rejected the username or password. Verify SQL authentication is enabled and re-enter the password.After correcting the account or connection details, click Test again.
Related
Section titled “Related”Use connection failed for network and TLS checks. Return to the SQL Server overview or continue with write and run SQL after connecting.