I’ve installed LocalDb server on my PC.
I am trying to create a connection to the LocalDB server in Navicat Premium.
I am unable to get the correct Host Name/IP Address for the LocalDB server.
I noticed by default LocalDB server always creates an instance named MSSQLLocalDB when started. I’ve searched the internet but couldn’t find the exact solution for my problem in Navicat premium software.
Here is the error I am getting:
I’ve installed only LocalDB server. Is it not a SQL Server native client? I don’t want to install both LocalDB server and MS SQL Server Express Edition as I have no need of SQL Server Express Edition.
Microsoft SQL Server Native Client 11.0 is installed when you install SQL Server 2016. There is no SQL Server 2016 Native Client.
I am using the recent SQL Server 2016 LocalDB. I believe the download links are for SQL Server 2012. I am using SQL Server 2016, which does not need a native client.
After trying out some more I was able to land on a new error as shown in the second image file below. I am sure that the instance name is correct as you can see in the image:
Is Navicat installed on the same computer as LocalDB? LocalDB doesn’t allow for remote connections.
Assuming that Navicat is installed on the same computer: is Navicat a service or desktop application? LocalDB runs, by default, as a private user process that only your Login can see (no problem for a desktop application that you are running). If you want others (such as a service) to be able to access your LocalDB instance, you need to share it using the
sqllocaldb.exe command line utility.
(localhost)MSSQLLocalDB is not a valid syntax. The reason for specifying
(localdb)InstanceName is that the
(localdb) portion of it is a special syntax that the underlying connection library understands and hands-off to the LocalDB library (it is special because it can auto start up that instance of LocalDB simply by trying to connect to it using that syntax).
Also #2: SQL Server Native Client is a connection library (ODBC is another type of connection library), and it is being used by Navicat to connect to SQL Server. If Navicat is saying that you need to install SQL Server Native Client, then you need to download it from Microsoft. And yes, the last version of it was for SQL Server 2012. But if Navicat requires it, then you kinda need it.
Now, it appears that Navicat Premium is a desktop app so you likely don’t need to worry about sharing the instance, unless there are other users logged onto your computer that you want to be able to access this instance. But for now, I will assume that it is only you using it. Keeping in mind the fact that LocalDB isn’t a service and so not always running, and that it can be auto-started by attempting to connect to
(localdb)something, it should be understood that it takes several seconds for the LocalDB instance to start. The amount of time it takes is longer than the default connection timeout, at least in SQL Server Management Studio (SSMS). So, when initially connecting, it is expected to get the timeout error, so immediately try connecting again. If you wait too long (several minutes) to attempt connecting again, you will get the timeout again as the instance will auto-shutdown after several minutes of no connections.
So, again, assuming that both LocalDB and Navicat are running on the same computer AND by the same Windows Login, try connecting to
(localdb)MSSQLLocalDB. When you get the connection timeout error, immediately try connecting again. If it doesn’t work, then something else is wrong.