Lỗi cannot connect sql server management studio 2023
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. Show
SQL Server Management Studio (SSMS) setup failed or requires restart
In this articleWhen facing SSMS installation problems, common error messages include:
Suggested resolutionFollowing these steps to uninstall the "Microsoft ODBC Driver 17 for SQL Server" before beginning the SSMS installation commonly allows the setup to succeed if it has previously failed with one of the above or similar error messages. Vào một ngày, bạn mở MS SQL Server đăng nhập vào nhưng không được và nhận được cửa sổ thông báo (như sau): Fix Error Can Not Login To SQL Server Đây là lỗi máy chủ SQL Server của bạn chưa được bật. Mặc định thì sau khi cài đặt SQL Server sẽ khởi động cùng windows, nhưng vì lý do nào đó (có thể là do virut, hay do một ứng dụng nào đó đã tắt chức năng tự khởi động theo windows) nên lúc bạn khởi động lên mà máy chủ SQL server không khởi động thì đăng nhập sẽ gặp lỗi (như hình trên) Để cách khắc phục lỗi này bạn có thể khởi động lại máy tính của mình một lần nữa có thể nó sẽ tự khởi động cùng windows. Tuy nhiên, về lâu về dài thì bạn cần bật dịch vụ (server sql server) khởi động cùng windows. Bật SQL Server khởi động cùng windows như sau: Bước 1: Mở cửa rổ RUN bằng cách nhấn tổ hợp phím: Window (biểu tượng cửa sổ) + R (cho các máy sử dụng HĐH Windows) Nhập vào "services.msc" nhấn Enter một cửa sổ quản lý các Services của windows mở ra Bước 2: Bạn tìm đến dòng SQL Server (SQLExpress) (Nhấn chữ S để duyệt tới cho nhanh). Trong đó SQLExpress là tên máy chủ của bạn (nếu đã thay đổi thì sẽ khác, mặc định là SQLExpress) của tôi là ITSQLEXPRESS (Xem hình dưới) Tìm đến dòng SQL Server (SQLExpress) Nhìn vào vùng khoanh đỏ bạn thấy services này chưa được Start và nó đang ở chế độ Manual (tức là không tự động khởi động (Automatic)) Bây giờ chỉ cần click chuột phải vào dòng đó rồi chọn Start là bạn có thể login vào được SQL rồi. Để máy chủ SQL Server tự động khởi động cùng Windows mà không cần phải vào đây để Start lại thì bạn thì Click phải chuột vào dòng đó, chọn Properties tại phần Startup Type: Chọn Automatic, đồng thời nhấn Start rồi nhấn OK để hoàn thành. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In this articleApplies to: SQL Server When connecting to a SQL Server instance, you may encounter one or more of the following . This article provides some steps to help you troubleshoot these errors, which are provided in order of the issues from simple to complex. Error messagesThe complete error messages vary depending on the client library that's used in the application and the server environment. You can check the following details to see if you're encountering one of the following error messages: "A network-related or instance-specific error occurred while establishing a connection to SQL Server. 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: 53) 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: 53) provider: TCP Provider, error: 0 - No such host is known. (Microsoft SQL Server, Error: 11001) provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified 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 Login timeout expired SQL Server Native Client Data Link Error [Microsoft SQL Server Native Client 10.0]: Login timeout expired [Microsoft SQL Server Native Client 10.0]: A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [Microsoft SQL Server Native Client 10.0]: SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 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: TCP Provider, error: 0 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. Microsoft SQL Server, Error: 10060 provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server 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: 53 The network path was not found [Microsoft][SQL Server Native Client 11.0]TCP Provider: No connection could be made because the target machine actively refused it SQL Server Native Client Data Link Error [Microsoft][SQL Server Native Client 11.0]TCP Provider: No connection could be made because the target machine actively refused it. [Microsoft][SQL Server Native Client 11.0]Login timeout expired. [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. "SQL Server does not exist or access denied"This error usually means that the client can't find the SQL Server instance. This issue occurs when at least one of the following problems exists:
Windows error 233: No process is on the other end of the pipeThe complete message is: A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233) This message means that SQL Server isn't listening on the Shared Memory or Named Pipes protocol. Gather information for troubleshooting the errorWe recommend that you gather the information listed in this section using one of the following options before proceeding with the actual steps to troubleshoot the error. Option 1: Use the SQL Check tool to gather the required informationIf you can sign in locally to the SQL Server computer and have administrator access, use SQLCheck from the Microsoft SQL Networking GitHub repository. This tool provides most of the information required for troubleshooting in one file. Review the tool's home page for more information on using the tool and the information it gathers. You can also check the recommended prerequisites and checklist page. Option 2: Collect the data individually using the following proceduresGet the instance name from Configuration ManagerOn the server that hosts the SQL Server instance, use SQL Server Configuration Manager to verify the instance name: Note Configuration Manager is automatically installed on the computer when SQL Server is installed. Instructions on starting Configuration Manager vary slightly by versions of SQL Server and Windows. For version-specific details, see SQL Server Configuration Manager.
Get the IP address of the serverYou can use the following steps to get the IP address of the computer hosting the instance of SQL Server.
Get the TCP port of the instanceIn most cases, you connect to the Database Engine on another computer by using the TCP protocol. To get the TCP port of the instance, follow these steps:
Step 1:Verify that the instance is runningOption 1: Use the output file from the SQLCheck tool
Option 2: Use SQL Server Configuration ManagerTo verify that the instance is running, select SQL Server Services in SQL Server Configuration Manager and check the symbol by the SQL Server instance.
If the instance is stopped, right-click the instance and select Start. Then, the server instance starts, and the indicator becomes a green arrow. Option 3: Use PowerShell commandsYou can use the following command in PowerShell to check the status of SQL Server services on the system:
You can use the following command to search the error log file for the specific string "SQL Server is now ready for client connections. This is an informational message; no user action is required.":
Step 2: Verify that the SQL Server Browser service is runningNote This step is required only for troubleshooting connectivity issues with named instances. Option 1: Use the output file from SQLCheck tool
Option 2: Use SQL Server Configuration ManagerTo connect to a named instance, the SQL Server Browser service must be running. In SQL Server Configuration Manager, locate the SQL Server Browser service and verify that it's running. If it's not running, start the service. The SQL Server Browser service isn't required for default instances. For more information on using SQL Server Browser service in your environment, see SQL Server Browser service. For more information on stopping and starting SQL Services, see Start, stop, pause, resume, restart SQL Server services. Step 3: Verify the server name in the connection stringYou often encounter errors when an incorrect server name is specified in the connection string. Make sure that the server name matches the one that you retrieved in the previous steps. Note If you are using the SQLCheck tool, review the NetBios Name/FQDN values in the Computer Information section of the output file.
Step 4: Verify the aliases on the client machinesAliases are often used in client environments when you connect to SQL Server with an alternate name or when there are name resolution issues in the network. They're created by using SQL Server Configuration Manager or client network utility. An incorrect alias can cause the connections from your applications to connect to the wrong server, resulting in failure. Use the following methods to check for incorrect aliases. You can also use a tool (such as SQLCHECK) on the client machine to check for aliases and various other connectivity-related settings on a client machine. Option 1: Use the output file from the SQLCheck tool
Example output: SQL Aliases:
The output indicates that Option 2: Check aliases in SQL Server Configuration Manager
Option 3: Check aliases in SQL Server Client Network Utility
Step 5: Verify the firewall configurationYou can verify the firewall configuration depending on the default instance or named instance. Note If you are using third party firewalls in your network, the concepts still apply. However, you may have to work with your network administrator or consult the firewall product's documentation for more information on configuring the firewall to allow necessary ports for communication with SQL Server. Default instance of SQL ServerA default instance typically runs on port 1433. Some installations also use a non-standard port (other than 1433) to run SQL instances. The firewall may block either port. To check the port number further, follow these steps:
Named instance of SQL ServerIf your SQL instance is a named instance, it may be configured to use either dynamic ports or a static port. In either case, the underlying network libraries query the SQL Server Browser service running on your SQL Server machine through UDP port 1434 to enumerate the port number for the named instance. If a firewall between the client and the server blocks this UDP port, the client library can't determine the port (a requirement for connection) and the connection fails. To check the connection, you can use one of the following methods:
Step 6: Verify the enabled protocols on SQL ServerIn some installations of SQL Server, connections to the Database Engine from another computer aren't enabled unless an administrator manually enables them. You can use one of the following options to check and enable the necessary protocols to allow remote connections to SQL Server Database Engine. Option 1: Use the output file from SQLCheck tool
Option 2: Use SQL Server Configuration ManagerTo enable connections from another computer by using the SQL Server Configuration Manager, follow these steps:
Step 7: Test TCP/IP connectivityConnecting to SQL Server by using TCP/IP requires that Windows establish the connection. You can use the following steps to test TCP connectivity by using the ping tool.
Step 8: Test local connectionBefore troubleshooting a connection problem from another computer, test your ability to connect from a client application installed locally on the computer that is running SQL Server. Local connection avoids issues with networks and firewalls. This procedure requires SQL Server Management Studio. If you don't have Management Studio installed, see Download SQL Server Management Studio (SSMS). If you can't install Management Studio, you can test the connection by using the sqlcmd.exe utility. sqlcmd.exe is installed with the Database Engine. For information about sqlcmd.exe, see sqlcmd Utility.
Step 9: Test remote connectionOnce you can connect by using TCP on the same computer, it's time to try to connect from the client computer. You could use any client application, but to avoid complexity, install the SQL Server Management tools on the client. After installation, try to use SQL Server Management Studio. |