I installed MSSQL server 2016 with configuration manager and management studio. I trying connect to SQL server via management studio:
- Server type: Database Engine
- Server name: localhost
- Authentication: Windows Authentication
Error TITLE: Connect to Server:
Cannot connect to localhost. 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2) The system cannot find the file specified
Nothing more information in event viewer. I have these services with states:
- SQL Server (SQLEXPRESS) - Running
- SQL Full-text Filter Daemon Launcher (SQLEXPRESS) - Running
- SQL Server Launchpad (SQLEXPRESS) - Running
- SQL Server Reporting Services (SQLEXPRESS) - Running
- SQL Server Agent (SQLEXPRESS) - Stopped
- SQL Server Browser - Running
After try start SQL Server Agent i get this error:
The SQL Server Agent (SQLEXPRESS) service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.
Thank you for any advice.
EDIT
I capture a screen of sql services:
4条答案
按热度按时间06odsfpq1#
I could solve the same issue only with server name
(localdb)\MSSQLLocalDB
. Just FYIxesrikrc2#
In an attempt to get all the answers in one spot (and hopefully help a future searcher), you can connect to the SQL box that SQL Management Studio is installed on by changing the
Server name:
in the connection dialogto one of the following:
(localdb)\MSSQLLocalDB
.
127.0.0.1
- by direct IP address, this is your loopback IP.\SQLEXPRESS
YOURCOMPUTERNAME\SQLEXPRESS2017
LOCALHOST
2sbarzqh3#
May be this is familiar to many, but I believe new starters may find this helpful! As similar like above snapshot provided in the problem, I did not find MSSQLSERVER service is showing in SQL Server Configuration Manager. The reason is that I just installed the exe, but failed to do sql server setup actually! To make my 'localhost' as server name with windows authentication works, I followed below steps.
Open SQL Server 2019 Installation Centre. [Note: For SQL Server Installation Media Path, choose location ]. This will open installation Wizard.
Go to Installation -> Choose 'New SQL Server stand-alone installation or add features to an existing installation'
In Installation Type -> Choose 'Perform a new installation of SQL Server 2019'
Follow the instructions and in between the setup, it will prompt to setup password for 'sa'. You can choose either windows mode or mixed mode ( i.e. windows and sql server authentication). [NOTE: This sa password setup will not be prompted during installation from exe.]
Complete the setup.
Once completed, you can see 'MSSQLSERVER' is running.
Just type in 'localhost' with windows authentication by default.
This time, just enter 'localhost' in server name like below
It will then connected immediately without any hassles.
krcsximq4#
Go the given link and download developer edition - once you have installed it, then you would see something like below -
From below picture you can find the server name, that you connect locally. enter image description here
Yo can also refer to my answer on - https://www.quora.com/profile/Sania-Fatimi/Installing-SQL-server-Developer-edition-SSMS-and-connecting-to-localhost-local-server-Go-the-given-link-and-downloa