Connect sql 2023 báo lỗi a network or instance-specific năm 2024

Địa chỉ : M17 Lê Hoàng Phái, Phường 17, Quận Gò Vấp, Tp.HCM

Phòng kinh doanh: 028.73002148, ngoài giờ 0907233866

Email: [email protected]

Customer Care: [email protected]

CN: Ấp 4, Xã Đồng Tiến, Huyện Đồng Phú, Bình Phước

CN: 1904 Quang Trung, Thị xã An Khê, Gia Lai

CN:116/5 Nguyễn Chí thanh, P.Tân An, TP. Buôn Ma Thuột, Dak lak

CN: Xã Nghĩa Thương, Huyện Tư Nghĩa, Quảng Ngãi

CN: 165 Nguyễn Văn Cừ, Phường Hoàng Văn Thụ, TP Bắc Giang

I've tried a couple of fixes online, including opening the registry editor, restarting windows installer and installing microsoft sql. I even updated my installed microsoft sql local db because i saw that what was installed was 2019 and not 2022. Still couldn't fix it.

Would really appreciate if someone can help me with this. I couldn't continue with what I need to do because I'm stuck trying to do that. It's been days. To whoever helps, thank you so much in advance. Just really desperate to solve this issue. I've exhausted everything, tried searching online and followed their instructions, but still didn't fix my issue. Might be unique to me.

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.

Posted on by65

Hello everyone,

I need your help. I have been struggling with this error since days and I don't seem to find the solution.

For a Devops mapping purpose, I had to rename my Virtual Machine (did it with SQL). I made sure the updates were made. After since, Whenever I compile a model I get this error in Visual Studio 2019 (see below). On the other hand, Synchronize Database is not showing any erros.

When I open the Log file of the model result compilation, (file name : BuildModelResult) I noticed that it is calling the old name of the VM :

Initialization of cross reference database failed. Connection:Data Source=OLDNAME;Initial Catalog=master;Integrated Security=True;Connect Timeout=100;ConnectRetryCount=5;ConnectRetryInterval=10 failed with exception message:System.Data.SqlClient.SqlException (0x80131904)

I will be greatful for any thoughts to help me with this.

Thanks alot!

RE: 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.

Lansweeper stores data, reports and settings in a database. Your database is hosted in either the Microsoft SQL Compact, Microsoft SQL LocalDB or Microsoft SQL Server database server. If you install Lansweeper under SQL LocalDB or SQL Server and the connection to your SQL instance is lost at some point, you may encounter errors such as the ones below.

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.

Sqlcmd: Error: Microsoft SQL Native Client: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

These errors indicate that Lansweeper is unable to locate the SQL instance hosting your Lansweeper database. It's important to note that this does not point to database corruption or to an issue with the database itself.

Though there are many possible causes for a loss of SQL connectivity, below are some troubleshooting steps you can try to resolve the issue. This article is divided into steps for the database and steps for the server. You can verify which database server you are using with the ConfigEditor tool or in the Lansweeper web console.

Resolving SQL connection errors under SQL Server

To resolve the SQL connection errors if your database server is a SQL Server (most commonly SQL Server Error 53), follow these steps:

  • Stop the Lansweeper Server service in Windows Services.
  • Stop your web server service in Windows Services. Your web server service is either IIS Express or World Wide Web Publishing Service (IIS).
  • Make sure the SQL Server and SQL Server Browser services are running at all times on the server hosting your SQL instance.
  • Right-click one of the services in Windows Services.
  • Select the Properties menu item.
  • Set the service's startup type to Automatic in the resulting pop-up and select OK.
  • Right-click the service and select Start, if the service is not already started.
  • Log into SQL Server Management Studio. If SQL Server Management Studio isn't installed on your Lansweeper server, we recommend downloading it online.
  • Make sure your SQL instance is configured for mixed (Windows and SQL) authentication, as the Lansweeper service and web console use a SQL user called "lansweeperuser" to connect to the database.
  • Right-click your SQL instance name in SQL Server Management Studio.
  • Select the Properties menu item.
  • Select the Security tab in the resulting pop-up.
  • Tick SQL Server and Windows Authentication mode.
  • Right-click your SQL instance name and select Restart.
  • If your Lansweeper service and/or web console are hosted on a different server than the Lansweeper database, make sure your SQL instance is set up to allow remote database connections.
  • Right-click your SQL instance name in SQL Server Management Studio, select Properties and open the Connections tab in the resulting pop-up.
  • Tick Allow remote connections to this server.
  • Open SQL Server Configuration Manager and select the Protocols item under SQL Server Network Configuration. There should be a shortcut to SQL Server Configuration Manager in your Start menu.
  • Right-click Named Pipes and select Enable, right-click TCP/IP and select Enable.
  • Right-click TCP/IP, select Properties and ensure that connectivity is enabled for the appropriate IPs in the IP Addresses tab.
  • Right-click the SQL Server service under SQL Server Services and select Restart.
  • If your Lansweeper service and/or web console are hosted on a different server than the Lansweeper database, make sure SQL Server traffic is allowed through your firewall(s). TCP port 1433 is the most basic port used by SQL Server, though other ports are sometimes used as well. More info on allowing SQL Server traffic through firewalls can be found in this Microsoft knowledge base article. Make sure your Data Source (SQL instance name) is correctly submitted in the ConfigEditor tool, found at Program Files (x86)\Lansweeper\Tools\ConfigEditor.exe on the servers hosting your Lansweeper Server service and web console. If the tool has multiple tabs due to your server hosting multiple Lansweeper components, make sure the Data Source is correct in both tabs. The SQL instance name submitted in ConfigEditor should match what you see in SQL Server Management Studio. If it doesn't, select the Data Source in each ConfigEditor tab and select Edit to correct it.
  • Make sure DNS is up-to-date and your database server's NetBIOS name resolves to an IP address. In the example above, the database connection will fail if DELPHINE cannot be successfully pinged from Command Prompt on the servers hosting the Lansweeper Server service and web console.

Within your Lansweeper configuration files you can replace your database server's NetBIOS name with its IP address, e.g. 192.168.1.4\SQLEXPRESS. This may not be a good idea in DHCP enabled networks however, as IP changes will break the database connection.