Cannot connect to UserPC\SQLExpress - sql-server

I just installed SQL Server Management Studio Express 2008. For the username 'sa', I tried to change the password and login through SQL authentication but it failed.
I tried to create a new new user too and login. While I try to login in to the SQL management Studio, this error is given - > Screenshot: http://i.stack.imgur.com/nzq6i.jpg
What's going wrong?

Verify that "SQL Server and Windows Authentication mode" is selected in the Server authentication section of your server's Security properties.

Looks like SQL server is not properly installed.check computer>manage >services and applications ... if you can see SQL server under that its install is successful. if not the problem is with the installation

Try restarting your SQL Server. Looks like the service is not accepting the connections.

Related

Cannot connect to SQL Server via SQL Server Authentication

I am using SQL Server 2014 Management Studio to connect to a SQL Server 2008 R2 instance. I can connect via Windows auth but none of the SQL Server authentication credentials work, even though they work for my coworkers on their computers. It says "Login Failed". It doesn't seem like any SQL Server authentication works for any server. Does anyone know of settings I can look for, anything with firewalls maybe? Or something on SQL Server that could be blocking just me?
Details say
Msg 18456, Severity: 14, State: 1, Line Number: 65536.
Login with windows, right click on the server and select "Properties".
In the Properties dialog click "Security".
In the right pane, under "Server Authentication", select "SQL Server and Windows Authentication mode".
Not sure if you need to restart SQL Service or reboot the server after this.
Following Tab Alleman Answer -
You will need to restart SQL service to activated the functionality.

Default SQL Authentication Details for SQL EXPRESS 2016

I'm attempting to remotely connect to my SQL Express 2016 server through MS SQL on my local machine however am having extreme difficulties with the authentication.. Well I assume it is an authentication issue as when I attempt connect to connect to it I receive the error message:
The remote computer refused the network connection.
When connecting through the sqlcmd I am using Windows authentication and have no issue, however to connect to it remotely I need to use SQL authentication and have no memory of creating an account so am wondering if there's a default login and password?
I believe this is the issue however it is quite likely i'm doing something stupid so any assistance would be appreciated!
You can create an account that can be used to connect to that SQLExpress instance by using SQL Server Management Studio. Expand the database you wish to create a login for in the Object Explorer. Under the Security folder, you can create a new login by right clicking the Logins folder.
Also make sure that your machine has its firewall configured to allow remote connections, the server has remote connections enabled, and that you are allowing logins for Windows Auth and SQL Server Auth.
You can allow remote connections for a server by opening the SQL Server Configuration Manager. Under the SQL Server Network Confiuration Node, Select Protocols for MYSERVERNAME. Ensure that TCP/IP is enabled.
Here's a guide on setting up the firewall: https://technet.microsoft.com/en-us/library/ms175043(v=sql.110).aspx
You can enable SQL Server Authentication by right clicking your server name in the object explorer in SQL Server Management Studio and going to the Security tab. look for the "Server Authentication" option.

ASP.NET MVC2.0 remote SQL server - Login failed for user '<username>'. Reason: Not associated with a trusted SQL Server connection

first I have checked that Server Authentication is already set to:
"SQL server and Windows Authentication mode" (mixed mode)
้here 's my web.config connectionstring
<connectionStrings>
<add name="StockConnectionString" connectionString="Data Source=192.168.0.2;Initial Catalog=Stock;Persist Security Info=True;User ID=op;Password=operator" providerName="System.Data.SqlClient"/>
</connectionStrings>
Whene I test running (ctrl+F5) under VS2010 development this can connect to remote SQL server without any problem. but when i publish this project to local IIS (same web.config) an error occured..
Login failed for user 'op'. Reason:
Not associated with a trusted SQL
Server connection.
also i can connect to SQL server via SQL server Management Studio with SQL server authentication same user/pass.
no idea what's wrong with this.
finally, after 3 days can't figure this out. then i tried start over.
created a new project (ASP.NET MVC 2 web app) in VS2010.
go to Database Explorer > Add Connection..
use SQL server authentication to remote SQLserver directly instead of local.
then gotcha!! it told me..
this server version is not supported. you must have Microsoft SQL server 2005 or later.
my project was created under Win XP connect to SQLserver 2000 and it's work fine. now the answer for an error above is..
Visual Studio 2010 dropped support for SQL Server 2000. You'll either have to go back to VS2008/SL3, upgrade your SQL Server, or do things manually outside of Visual Studio.
...really appreciate this so much
Does it make any difference if you add this to the connection string ?
Trusted_Connection=False;
A clue is that it's saying that it's not trusted which indicates it's not using the username and password from the string. Has a connection string been possibly imported into IIS ?
Trusted is windows authentication which by the error is being used. Sql server authentication is username and password which you are trying to use.

What is the default username and password of my SQL Server Express?

It installed automatically with Visual Studio 2010 Ultimate. I didn't create any users for the server or ANYTHING.
I'm using:
string connectionString = #"Server=.\SQLEXPRESS;Database=SportsStore;Trusted_Connection=yes;";
I get error that authentication failed. So the server is being found, but my credentials are wrong. What would the default login and password be?
Edit: Still not working! :(
Here's my connection string:
string connectionString = #"Server=.\SQLEXPRESS;Database=SportsStore;Integrated Security=SSPI;";
And the error message:
Cannot open database "SportsStore"
requested by the login. The login
failed. Login failed for user
'ToshibaLaptop\Sergio'.
If you are using SQL Server authentication you could try the username sa and blank password but I am not sure whether this is by default. Integrated Windows authentication should work, so you should be able to connect with your Windows account:
string conn = "Data Source=.\SQLExpress;Initial Catalog=mydb;Integrated Security=SSPI;";
You probably should not connect using Sql Server Authentication.
Log in as an Administrator on the box, connect using Integrated Windows Authentication, and you should be a system admin.
The error message indicates that SQL Server can't open the database. I think you're successfully authenticating, but having a problem connecting to the database. Is the database available?
You can do a test by changing the database to master in your connection string. If that succeeds, then you're problem is related to the database. I understand that you may get other errors, but the test is to confirm that you can login to SQL Server.
For me SQL Server (SQLEXPRESS) service was disabled so it was throwing the error. After enabling the service SSMS is working fine
Goto Run command and type services.msc and click on OK button
Services window will open. Check the status of SQL Server (SQLEXPRESS) service
If the service is not running, then start the service
Now try logging in again in the SSMS.
In SQL 2008 if you use the defaults there won't be a SQL Server user only Windows Authentication will be enabled - and it will only work for the user that installed the application would have access via their Active Directory authentication.

SQL Server 2008 Express Edition Connection Issue

I have VS 2008 Professional Edition. After the installation (which included SQL Server 2008), I decided to install SQL Server 2008 Express Edition with Advanced Tools (so I could get SQL Server Management Studio on it). So I uninstalled the SQL Express that came with VS 2008, and installed the standalone SQL Server Express 2008 version with advanced tools.
However, When I try to logon onto SQL Server Management Studio using:
.\SQLEXPRESS
as Server name and Windows Authentication as the authentication, I get the following message:
TITLE: Connect to Server
------------------------------
Cannot connect to .\SQLEXPRESS.
------------------------------ ADDITIONAL INFORMATION:
A network-related or instance-specific
error occurred while establishing a
connection to SQL Server. The server
was not found or was not accessible.
Verify that the instance name is
correct and that SQL Server is
configured to allow remote
connections. (provider: SQL Network
Interfaces, error: 26 - Error Locating
Server/Instance Specified) (Microsoft
SQL Server, Error: -1)
For help, click:
http//go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476
------------------------------ BUTTONS:
OK
------------------------------
Any suggestions on how to get it to work? I have tried disabling Windows Firewall as well and still no luck.
I am using WIndows Vista and SQL Server 2008 Express SP1 Patch has also been applied recently.
FIX: For those interested:
I did not have any of the Instance Based installation installed (i.e. the Database engine). I Installed the instance based stuff and it fixed it!
Start your Local SQL Server Service
Start SQL Config Manager: Click Start -> Microsoft SQL Server 2008 R2 -> SQL Server
Configuration Manager
Start SQL Services: Set the SQL Server (SQLEXPRESS) and SQL Server Browser services to automatic
start mode. Right-click each service -> Properties -> Go into the Service Tab
This will ensure they start up again if you restart your computer. Please check to ensure the state is "Running" for both services.
Login and authenticate with your Local SQL Server
Now open up SQL Server Management Studio and click "Connect to Object
Explorer" and select Server Name:
[Your PC name]\SQLEXPRESS
Example: 8540P-KL\SQLEXPRESS or (localhost)\SQLEXPRESS
To find your PC name: Right click My Computer -> Properties ->
Computer Name tab
Alternative: Login using windows authentication: Using the user name [Your
Domain]/[Your User Name]
Setup User Account
Create a new Login acct: In SQL Mgmt Studio -> Expand your local Server -> Security -> Right
click on Logins -> New Login
Set Password settings on New User Account: Uncheck Enforce password policy, password expiration and user must
change pw(Since this is local) Default database -> Your Database
Grant roles to New User Account: User Mapping Page -> Map to your db and grant db_owner role Status
Page -> Grant Permission to connect and Enable Login
Setup Access Permissions/Settings for User
Enable all auth modes: Right click your Local Server -> Properties -> Security Tab -> Enable
SQL Server and Windows Authentication Mode
Enable TCP/IP: Open SQL Server Configuration Manager -> SQL Server Network
Configuration -> Protocols for SQLEXPRESS -> Enable TCP/IP
Restart SQL Server Service: You will have to restart the SQL Server(SQLEXPRESS) after enabling TCP/IP
Database Properties File for Spring Project
database.url=jdbc:jtds:sqlserver://[local PC Computer
name];instance=SQLEXPRESS;DatabaseName=[db name];
database.username=[Your user name] database.password=[Your password]
database.driverClassName=net.sourceforge.jtds.jdbc.Driver
If you want to view larger screen shots and better formatting of the answer with more details please view the blog article below:
Setting up a Local Instance of SQL Server 2008 Blog Post:
you can look for your instance name in SQL Server Configuration Manager. It is written between brackets after SQL Server service in the services list.
the . notation is correct and it's the same as (local)
Did you try using (local)\SQLEXPRESS in the name? I've not seen that . notation before.
Scott,
I had to enable SQL Server Browser in services once I did that I was able to connect on My recent install.
after that I only had to use the computer name as the server.
edit,
while researching further on finding sql server browser, noted that reporting services, service showed its instance as .\computer name.
try that as the server name.
edit again change to backslash been playing with linux recently :)
There is a possibility that you installed as Default instance. In this case, try connecting using (local) - just (local).
Then go to Programs/Microsoft SQL Server/Configuration Tools/SQL Server Configuration Manager. Go to SQL Server Network Configuration/Protocols for MSSQLSERVER and enable Named Pipes.
Have you tried looking at the SQL Server Surface Area Configuration? You might only have SQL Authentication setup and might need to enable Network and SQL Authentication.
-JFV
I have an application that uses a connection string trough VSOT in Word 2007.
The application gave a connection error.
I allways install Sql server 2008 Express R2 in mixed mode so that i can use the build in sa with i password to connect.
I re-entered the password to be sure its correct. In a next step i opened:
‘Configuration manager’ in ‘Program files’ ‘Microsoft Sql Server 2008’ –->’ Configuration Tools’ and set all the other instances on the properties --> hide instance 'yes'
That solved the problem in my case.
Danny
If you still have problems connecting to SQL Express 2008,
read this article
http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/
It tells you about configuring SQL express after installation

Resources