I just downloaded the latest version of SQL Express 2012 but I cannot connect to localhost. I tried localhost\SQLExpress and Windows authentication but it gives me an error message saying cannot connect. Am I missing something here? I've used SQL Server 2008 before and I've never had issues connecting to localhost. It seems that it can't even find it. Also in the Services I only see a SQL Server VSS Writer. Is this the way it should be? Or am I missing something? Thanks
相关问题
- How do I get values for all months in T-SQL
- Why can't I connect to a SQL Server 2012 Local
- Silent Install of SQL Server Express 2012 from Inn
- sql server restoring back up error
- Wait on the Database Engine recovery handle failed
相关文章
- Why can't I connect to a SQL Server 2012 Local
- Silent Install of SQL Server Express 2012 from Inn
- sql server restoring back up error
- Wait on the Database Engine recovery handle failed
- System.Data.SqlClient.SqlException: - ASP.NET MVC
- 远程SQL Server连接字符串(Remote SQL Server connection str
- 不能附加在SQL Server中的示例数据库2012 [关闭](Can't attach t
- 不能附加在SQL Server中的示例数据库2012 [关闭](Can't attach t
First try the most popular solution provided by Ravindra Bagale.
If your connection from localhost to the database still fails with error similar to the following:
Under the "IP Addresses" section, find subsections with IP address 127.0.0.1 (for IPv4) and ::1 (for IPv6) and set both "Enabled" and "Active" to "Yes", and TCP port to 1433.
Go to
Start > Control Panel > Administrative Tools > Services
, and restart the SQL Server service (SQLEXPRESS
).I had a similar problem - maybe my solution will help. I just installed MSSQL EX 2012 (default install) and tried to connect with VS2012 EX. No joy. I then looked at the services, confirmed that SQL Server (SQLEXPRESS) was, indeed running.
However, I saw another interesting service called SQL Server Browser that was disabled. I enabled it, fired it and was then able to retrieve the server name in a new connection in VS2012 EX and connect.
Odd that they would disable a service required for VS to connect.
The problem for me was that I was not specifying
.\
. I was only specifying the name of the instance:SQL2016
.\SQL2016
According to Aaron Bertand:
You need to verify that the SQL Server service is running. You can do this by going to
Start > Control Panel > Administrative Tools > Services
, and checking that the service SQL Server (SQLEXPRESS
) is running. If not, start it.While you're in the services applet, also make sure that the service SQL Browser is started. If not, start it.
You need to make sure that SQL Server is allowed to use TCP/IP or named pipes. You can turn these on by opening the SQL Server Configuration Manager in
Start > Programs > Microsoft SQL Server 2012 > Configuration Tools
(orSQL Server Configuration Manager
), and make sure that TCP/IP and Named Pipes are enabled.Verify your SQL Server connection authentication mode matches your connection string:
If you're connecting using a username and password, you need to configure SQL Server to accept "SQL Server Authentication Mode":
otherwise, run
Start -> Run -> Services.msc
If so, is it running?If it's not running then
It sounds like you didn't get everything installed. Launch the install file and chose the option "New installation or add features to an existing installation". From there you should be able to make sure the database engine service gets installed.
Try changing from windows authentication to mixed mode
All my services were running as expected, and I still couldn't connect.
I had to update the TCP/IP properties section in the SQL Server Configuration Manager for my SQL Server Express protocols, and set the IPALL port to 1433 in order to connect to the server as expected.