SQL Server 2008 erroneously returning SQL Authentication failed - authentication

I am attempting to connect to SQL via SQL authentication. On SQL Server I receive Login succeeded, yet via code I get Login failed for user 'geneva'. I verified the login in SSMS and am able to connect via Windows authetnication. The sql user has full rights. Tried via java/.net code, really unsure why I am unable to connect via SQL Auth.
Data Source=server;Initial Catalog=GenevaWorkflow;User ID=user;Password=password
The environment is SQL Server 2008/Windows 2008. Very frustrating being all I want is to connect via SQL authentication and SQL Server I set to mixed mode authentication.

Enable sql logins in server properties (from management studio) and restart sql server.

Related

SQL Server error 18456 [duplicate]

This question already has answers here:
Login failed for user (Microsoft SQL Server, Error:18456) SQL Server 2005
(2 answers)
Closed 6 years ago.
windows unable to connect to SQL server with windows authentication mode I haven't created SQL authentication.Server name is AYAZ .Server is able to connect with Analysis and Reporting service but unable to connect with Database engine
Here is another suggestion:
SQL Server allows only SQL logins in the SQL Authentication mode. The logins are defined within SQL Server.
In short, if you want to use Window account to connect to SQL Server, connection string should not have user name and password. It would be something like below. Instead of username and password, we need to use “Integrated Security=SSPI”
Provider=SQLNCLI11.1;Data Source=SQLSERVER2016;Integrated Security=SSPI
For additional information: http://blog.sqlauthority.com/2016/02/17/sql-server-fix-error-18456-severity-14-state-6-login-failed-for-user/
Follow the below steps described here
Logon as a local administrator.
Stop the "SQL Server" service and run "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn\sqlservr.exe" -m" (start SQL
Server in Local Only mode.)
Logon to SSMS from the server itself - no password required.
Add my own domain account as a Login, with sysadm server role.
Restart the SQL Server service

SQL Server 2008 R2 login not working

I have just installed SQL Server 2008 R2 Management Studio. But I do not know what is the default login.
I searched over internet for solution, but no luck!
I have tried following solutions:
Server Type: Database Engine
Server Name: .
Authentication: Windows Authentication
and
Server Type: Database Engine
Server Name: .\SqlExpress
Authentication: Windows Authentication
But not sure why not working, I keep getting the following error:
Connect to Server
A connection was successfully established with the server, but then an
error occurred during the pre-login handshake. (provider: SSL
Provider, error: 0 - The message received was unexpected or badly
formatted.) (Microsoft SQL Server, Error: -2146893018)
There is no default login for windows authentication. I believe you need to add the current user as an administrator to login. Did you select SQL and Windows authentication and provide an SA password?
OP, has your computer had any recent updates? The SQL services tend to stop when system receives big updates, check that there are no services stopped.
The only reason I'm assuming this is your solution is because I see you can't even log in with Windows Authentication
It looks like you have only installed SQL Management Studio and not SQL Server with Tools i.e. SQL Server plus SSMS. I guess this is what you need?
It looks like you have only installed SQL Management Studio and not SQL Server with Tools i.e. SQL Server plus SSMS. I guess this is what you need? Also there is nothing wrong with your machine it is just that you require an instance of sql and you have only installed the management studio so you now just need to install sql server 2008 R2 express (FREE) I would suggest.

Connection string failing for SQL server 2012

I'm trying to connect to my db on my local machine with the following connection string and it fails for the following connection string
conn = new SqlConnection("Server=(local);DataBase=dnn6;Integrated Security=SSPI");
I'm using IIS 6 as my web server and when I open that page I get the following error.
Cannot open database "dnn6" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\demo'.
I'm using SQL Server 2012
The problem is that the IIS account being used to access SQL Server (IIS APPPOOL\demo) does not have access to it.
You need to either:
grant permission for the user IIS APPPOOL\demo to your SQL Server
use impersonation to connect to SQL Server with a user account that has access
use SQL Server Logins to access SQL Server using a named user (not recommended these days)

Cannot connect to sql server 2008 using JDBC

I have tried all the methods to connect to the server.I am using sql server 2008 on mixed authentication mode.I can login via the sql server management studio using the sa login.But when I try accessing the same db from my java program I get the following error:
SQL Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'sa'. ClientConnectionId:191d94bb-a55e-47a0-bb9f-b84638313cf4
This is my connectionstring:
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl= "jdbc:sqlserver://localhost;databaseName=Northwind;user=sa;password=sa;";
I have accessed my database in the same way. One of my problems were that I hadn't enabled the port and IP for the database. Check these options in SQL Server Configuration Manager. Hope this helps =)

SQL Server authentication in SQL Server 2008

I created a login with SQL authentication credential in SQL Server 2008. But, I am not able to login using that credential.
We followed the same steps in SQL Server 2005 and working without any problem.
What could be the problem?
Thanks,
P.Gopalakrishnan.
Have you checked that SQL Server Authentication is enabled? It is disabled by default. From SQL Server Management Studio, right-click your server, Properties, Security, SQL Server and Windows Authentication mode.
have you confirmed that you are logging into the correct instance of sql server on the machine that you created the login for?