Cannot connect to "local" (SQL Server 2008) - database

I have some database problems.
I have SQL Server Developer installed on my local machine. When I open SQL Server Management Studio and log in with windows authentication there is no problem. I have created a new database there and added a new user. The new user is owner of the database.
When I disconnect from my windows session and try to log in with the newly created user in SQL Server authentication mode I get the 'cannot connect to (local)'
Please help!

Have you enabled SQL Server authentication? (During installation and/or afterwards)
If not, connect using windows authentication, right-click on the server instance, go to properties and change auth mode...

Related

Get SQL Server database server address

I am installing an app and I am at the point where I am supposed to provide the server details. I installed SQL Server Express and I also installed SQL Server Management Studio.
This is the screenshot:
I did execute this command
select ##servername
but I got this response:
I am running this on my local machine. How can I find the database server address and also the server password?.
PS: I do not remember setting any password when installing SQL Server.
Thanks.
When you executed the command select ##servername, how were you connected to the server? Running that command required knowing the servername and authentication of some kind. I'm guessing you were connected to DESKTOP-KOJLCIF\SQLEXPRESS or .\SQLEXPRESS using windows authentication.
When you installed SQL Express, there was an option for Windows Authentication or SQL Server + Windows (aka Mixed Mode) Authentication. If you chose Windows Authentication (which is the default if I recall), you will not have SQL Server usernames or passwords.
The app you are installing appears to required SQL Auth, so you need to pick Mixed Mode in your setup (which allows both Windows Auth and SQL Auth). You can find this setting in recent versions of SQL Server Management Studio by right-clicking your database server in object explorer, going to Properties, and then looking at the Security page. Older versions of SQL require going to another tool included in the installation folders-- server configuration or some such, the name escapes me. Change the authentication to "SQL Server and Windows Authentication mode". I believe a SQL Server restart is required after doing this.
You can then create SQL logins with username and passwords and appropriate permissions using the GUI in SSMS (expand security folder under your server and look at the logins sub folder) or via CREATE LOGIN t-sql command.
There is a fixed sql login called 'sa' that will always exist if SQL Auth is enabled. You could right click this login, go to properties, and change the password. Be careful giving out your sa credentials to an app, as that can control the entire server.

Error 18456 loggin on a SQL Server 2016

I had an unexpected system crash and had to setup SQL Server 2016 again. I can connect to the server from SSMS if I use a Windows authentication account, but not via any login created. I keep getting an error 18456:
Login failed for user 'sa'
Steps:
I have enabled SA login and gave it a password but cannot connect via SSMS
I have created another login and matched it to my project database, the project database now has the login under its users but again, I cannot log in.
SSMS is installed on the actual db server so I doubt this is a remote login issue, but as the db server is isolated from the actual site I would like to update this if needed.
Any ideas would greatly be appreciated!
Did you enable the mixed mode authentication?
Did you restart SQL services after changing the mixed mode authentication?
Some of the server level properties takes only after a SQL restart , one such is authentication modes.
Usually a SQL Service problem.
Start - > View Local Services -> SQL Server(SQLEXPRESS) > restart it

SQL Server 2012 Express login failed from client machine

I have installed SQL Server 2012 Express edition on a pc which is on a workgroup running Windows 10. I have also created an user for access to the database through the VS2013 application.
When trying to connect to the server from the client machine, I am getting a message saying login failed and it is from an untrusted domain. The client is also on the same workgroup. However, after the SQL Express was installed on the "server" machine, the name of that pc was changed. I can connect to the database from the server using SSMS using the new computer name (in the instance). I have set remote connection parameters and also configured firewall rules. Yet I am unable to access the server from the client machine.
I also want to ensure that the database is totally secured against access or intrusion. Anyone having access to the server machine can view/edit the database using Windows Authentication. How best to safeguard against it?
Any tips would be appreciated.
CL
try to make a new user in server machin using SSMS and be sure that you are adding the new user to the Login Part of Security in SSMS . For this you need to Login to SSMS as administrator ...

Cannot connect to SQL server from workstation - Microsoft SQL Server 2008 R2 (SP2)

I face the following isuse on a Microsoft SQL Server 2008 R2 (SP2):
Login failed for user ''. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only.
My SQL server has mixed mode enabled (i verified and switch it on and off several times)
I am able to loging from a peer server which is a replica with the same windows accounts
I am unable to loging from a Windows workstation
The DSN configuration in Windows is succesful though
If mixed mode is enabled why would the server tell me it is not?
What could cause the server to believe it is Win authentication only although the setup is mixed mode?
Wireshark did not help.
I traced back the changes on the server it appears that the main administrator user was renamed. A new sys admin user was created and I had to add this user in both Windows SQL Security groups.

Connecting to remote SQL Server

I have installed SQL Server 2005, the SQL Server instance name is SOSO, the machine name is HERO, I tried to connect from another computer using SQL Server Management Studio:
Server name: HERO\SOSO
Authentication: Windows Authentication
But I didn't succeed.
SQL Server is enabled to be connected remotely.
So what is the problem?
Windows Authentication uses the Active directory user from the connecting machine to authenticate with the database. Does it have the right permissions to access the database? Maybe try authenticating with a SQL Server database user first. Maybe you've created a SA user on installation, try connecting with that.
But as the other replies also tell, first check network / firewall connection and please provide us with the error message.

Resources