I can't connect to my LocalDB (LocalDB)\MSSQLLocalDB [2016] - sql

In my machine was installed several versions of SQL Server 2008,2016,2019, but in my current project I have to work only with 2016. I uninstalled 2019 version (because some times the file .mdf that I use to up to source code was generated on the wrong version [2019] and I couldn't find the reason, so I decided to uninstall 2019) after that I got error to accessing LocalDB.
Firstly the error said something like Parenting to MSSQL15 I don't remember the exact error, but that make me think the DB was still pointing to 2019 so I uninstalled and reinstalled SQL Server 2016 and now I having another error.
In SSMS if I try to connect to (LocalDB)\MSSQLLocalDB I get:
Cannot connect to (LocalDB)\MSSQLLocalDB.
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: 0 - [x89C50118]) (Microsoft SQL Server,
Error: -1983577832)
If I go to CMD to see what I have as servers I get:
C:\Users\rmarchetto>sqllocaldb info MSSQLLocalDB ProjectsV13
But if I try to access specifically MSSQLLocalDB I get:
C:\Users\rmarchetto>sqllocaldb info MSSQLLocalDB Call to
LocalDBFormatMessage failed. Error code returned:
2311389448. Error in LocalDBFormatMessage! Error code returned:
2311389454.

I solved the problem, actually I don't known literally which keys u must delete but, to stop the problem of parenting to another SQL version I needed to go to "Registry Editor" and I deleted every key on :
Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Microsoft SQL Server\UserInstances
After that I was able to connect to my (LocalDB)\MSSQLLocalDB [2016] without further errors =)

Related

Cannot connect to (LocalDB)\MSSQLLocalDB -> Login failed for user 'User-PC\User'

I am getting an error, While I am trying to connect (LocalDB)\MSSQLLocalDB through SQL Server management studio. I also tried to login with default database as master the error is same.
Here is the Server details.
Warning: this will delete all your databases located in MSSQLLocalDB. Proceed with caution.
The following command through sqllocaldb utility works for me.
sqllocaldb stop mssqllocaldb
sqllocaldb delete mssqllocaldb
sqllocaldb start "MSSQLLocalDB"
After that I restarted the sql server management studio, and it is successfully established connection through (LocalDB)\MSSQLLocalDB
For this particular error, what gave me access to my MDF in VS2019 was:
In Solution Explorer, right click your MDF file
Detach
That was it and I now have access. I was expecting to detach and attach, but that wasn't needed.
I also could not get to my (localdb) in SSMS either, so what helped me there was a solution by Leniel Maccaferri. Here is the link to his site, along with the excerpt that helped me:
https://www.leniel.net/2014/02/localdb-sqlserver-2012-cannot-open-database-requested-by-login-the-login-failed-error-4060.html
So guess what: the solution is ridiculously easy once you know what to do of course…
Click that Options >> button in Figure 1. Now select the Connection Properties tab.
SSMS Connect to Server | Connection Properties | Connect to database optionFigure 2 - SSMS Connect to Server | Connection Properties | Connect to database option
I had to type master in Connect to database field since I did not have it in the list of available databases.
Now click connect and you’re done.

Error in BeginStartup CollaborationPlatform using ProvisionedApplicationPlatformSettings

I am trying to create an ApplicationEndpoint by first creating and establishing the CollaborationPlatform using ProvisionedApplicationPlatformSettings, when i execute:
ProvisionedApplicationPlatformSettings settings = new ProvisionedApplicationPlatformSettings("MYAPP", _appID);
_collabPlatform = new CollaborationPlatform(settings);
_collabPlatform.BeginStartup(EndPlatformStartup, _collabPlatform);
in EndPlatformStartup method while executing collabPlatform.EndStartup(ar); i get an error
ProvisioningFailureException:
One or more values in the configured settings are invalid or unusable. Check inner exception and logs for more details.
The settings wrapper failed to initialize.
Unable to find the Sqld database: 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)
Found the Answer/Error,
i was trying to run the application from Windows 7 PC which apparently is not supported for Auto Provisioned Application , so now i build the application on my Win7 PC and then execute it on the Lync Server.

Cannot start LocalDB

Cannot start LocalDB instance, I have installed and re-installed over and over.
Keep getting this error :
Start of LocalDB instance "v11.0" failed because of the following error:
Error occurred during LocalDB instance startup: SQL Server process failed to start.
Anyone any advice ? ?
Microsoft SQL Server 2012, i have ensured the FULL installation options, stopped all services SQL related and tried restarting .
sqllocaldb info
gives me :
Projects
v11.0
when i try
sqllocaldb start v11.0
I get the above error.
When all else fails and you don't care about data loss, delete and recreate your LocalDB\v11.0 database! At the command prompt
sqllocaldb delete v11.0
sqllocaldb create v11.0
(Sqllocaldb is in your PATH right? It was for me.)
I was getting a similar error, but when running
sqllocaldb start
The local db started successfully. Also when checking the event log I saw an error along the lines of
Windows API call WaitForMultipleObjects returned error code: 575
What fixed it for me:
In IIS, configure the app pool to run under an account with permissions to the DB on the server (advanced options of the app pool)
In the advanced option of the app pool, set Load User Profile to true
Reference: http://blogs.msdn.com/b/sqlexpress/archive/2011/12/09/using-localdb-with-full-iis-part-1-user-profile.aspx
It worths looking at LocalDB log files too, it is more detailed than event log:
%LocalAppData%\Microsoft\Microsoft SQL Server Local DB\Instances\ProjectsV12\error.log
Besides recreating the instance I had to delete the content of this folder:
%LocalAppData%\Microsoft\VisualStudio\SSDT\
This is where I have the mdf and ldf files.
My solution:
Go to: %LocalAppData%\Microsoft\Microsoft SQL Server Local DB\ and allow total control of the folder "Instances" to everyone group.
I know this is not OK but it solved my problem and i don't really care about the data of that folder as this is a developing and testing computer.
Same problem here. Here's how I fixed it using bits of the other solutions posted here.
I had dozens of these errors in the application event log:
Windows API call WaitForMultipleObjects returned error code: 575. Windows system error message is: {Application Error}
The application was unable to start correctly (0x%lx). Click OK to close the application.
Reported at line: 3730.
I realized that I had SQL Server Management Studio installed on my development machine, but no other SQL components. I installed the database engine, shared components, and localdb from SQL Express
https://www.microsoft.com/en-us/cloud-platform/sql-server-editions-express
After installing, I still get the same error in event log :(
Found this article:
Cannot start LocalDB
Run the following in cmd to get the localdb instance name:
C:> sqllocaldb info
In my install, I had:
MSSQLLocalDB
ProjectsV13
I ran the following to delete the instances:
sqllocaldb delete MSSQLLocalDB
sqllocaldb delete ProjectsV13
I ran into issues trying to delete/create these (sqllocaldb delete MSSQLLocalDB). I ended up deleting all of the folders and files under '%LocalAppData%\Microsoft\Microsoft SQL Server Local DB\Instances*' (You need to stop SQL Server and kill all sqlserver processes)
Then running 'sqllocaldb create' created and started the default instance and all files.
Had this issue suddenly too but saw nothing weird in logs. Was able to get it running by running the following in an administrator command prompt:
sqllocaldb start
I had this issue. I was trying to use Windows Authentication through an application, but the IIS App Pool credentials were wrong. I was using my Windows user name (ie: NETWORK\name) as my identity, but I changed it to the built-in "LocalSystem" and it worked.
You should check the Event Log for additional information.
Product Name
SQL Server
Product Version
11.0
Product Build Number
Event ID
266
Event Source
SQL Server Local Database Runtime 11.0
Component
Local Database Runtime API
Message Text
Error occurred during Local Database instance startup: SQL Server
process failed to start.
Explanation
A SQL Server process is started but SQL Server startup failed.
User Action
See the event log for details.
Source: http://msdn.microsoft.com/en-us/library/hh256140.aspx
What worked for me was the local IIS application pool I was using was the ApplicationPoolIdentity and that did not have permission to login to MSSQLLocalDB. As soon as a I changed the app pool identity to my windows login account - I was able to connect ok.
Had this issue on Windows 10 when our application was run with compatibility for Windows 8 enabled. Turning off the compatibility setting fixed it.
Before you try something drastic:
After waiting for about 5 minutes it "healed" itself.
(May be this is what this log message is pointing at: "The RANU instance is terminating in response to its internal time out")
I can not yet comment posts here but I really want to give a hint for the in my case extremely helpful post https://stackoverflow.com/a/30298863/8015089 above:
If your LocalDB instance is run by the Windows SYSTEM user (as in my case) the path to error.log is this (MS SQL Server 2012 Express LocalDB on Win11): C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\<InstanceName> (enter this path subfolder by subfolder to avoid access problems!)

Problem running SSIS with ORACLE Data Source problem in Windows 64 bit

I've managed to connect my SQL Server 2005 in Windows 64 bit server with ORACLE database. (Thanks to Mr. Jeyong Park :http://knol.google.com/k/jeyong-park/accessing-oracle-data-source-from-64bit/3vywlm4f31xae/12)
The problem is :
In SSIS when I used Oracle as a OLE DB Data Source and previewed the data, it works, however, when I run the Package, the OLE DB Data Source task failed with the message :
[OLE DB Source [10882]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.
The AcquireConnection method call to the connection manager "PROD_cm" failed with error code 0xC0202009.
There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Since I can preview the data, I think there's no problem with the connection.
Please help...
When I encountered this problem a year ago with SQL Server 2008 on Windows Server 2003 64-bit the issue was caused by incorrect drivers. What is the version of the Oracle database to which you are connecting? If you are connecting to a 8g or 9i Oracle server, then you need to use the 9i Oracle drivers. If you are connecting to a 10g or better server, then you can use the 11i drivers.
Have you tried running the SSIS package while logged into the server as the SQL Server Agent service account or have you only tested this on your workstation? If it works on your workstation and doesn't work while logged into the server as the service account, then this screams driver issue to me.
Another possible problem is that you tnsnames.ora file may not be correctly setup. The file contents should be something like the below code for the 9.2 drivers. Please note you need to replace , , and with appropriate values.
# tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.
<SERVER_NAME> =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <IP_ADDRESS>)(PORT = <PORT_NUMBER>))
)
(CONNECT_DATA =
(SID = <SERVER_NAME>
(SERVER = DEDICATED)
)
)
One more possible solution. If you can get the linked server connection working and cannot get the data flow to work for some reason, then you could execute a linked server query to pull down the data. I remember doing this for about 6 months when we couldn't get the MYSQL drivers to work with the CTP of SQL Server 2008. Eventually we found the right solution, but this helped us through the short-run period to get up and running.
One of The following should work:
Check the tnsnames.ora file - It should have the connection details to the Oracle DB hat you are trying to connect through your package.
Check if the Oracle DB you are trying to connect to is working. I wasted around two days finding a root cause of the error and later came to know that the Oracle DB was shut down.
Check that the passowrds are intact in the configuration manager/Connection string.
If you have been working for long on the package try closing and opening it again. The

Error Opening CrystalReport viewer

I have this problem which I am trying to debug for a lot of time.
The setup is like this:
i. The application is a Windows application developed using VS2005, .net 2.0.
ii. I use the Cyrstal reports component Crystal Report Viewer and dynamically display various reports in the same form.
iii. The db is SQLSERVER Express 2005 and situated on a different machine.
When I run the application on the db server, I am able to view the report. However, when I run the application on a different machine which is connected to the above dbServer, I get an error. ( I dont get this error on my dev setup)
Source: CrystakReprotViewer.CS:SendDBLogonForReport() Details:Logon failed.
Details: ADO Error Code: 0x
Source: Microsoft OLE DB Provider for SQL Server
Description: [DBNETLIB][ConnectionOpen (Invalid Instance()).]Invalid connection.
SQL State: 08001
Native Error:
Error in File C:\DOCUME~1\admin\LOCALS~1\Temp\ActionPoints {52820D22-199C-4D46-A76B-70A55D9F54D5}.rpt:
Unable to connect: incorrect log on parameters. at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetTableLocation(ISCRTable CurTable, ISCRTable NewTable)
at CrystalDecisions.CrystalReports.Engine.Table.set_Location(String value)
at Trivalve.UI.Client.Reports.CrystalViewer.CrystalReportViewer.SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument) in D:\Ramjee\Work\Projects\Trivalve\Trivalve\src\tfssetup\2008\Trivalve_2008\Trivalve\Reports\CrystalViewer\CrystalReportViewer.cs:line 127 rptcontrollers.dll SetTableLocation
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Thanks,
Ramjee
Use datasource=servername or ip address\instance name if available,port number
Default port number is 1433 or 1434
My problem was solved with this. Posting for the use of others.
If this is a standard installation of SQL Server Express, bear in mind that the only connection method installed by default is shared memory, and is only available on the server -- you would need to enable another connection protocol such as Named pipes or TCP/IP. To turn networking on, Use SQL Server Configuration Manager to enable relevant protocols and start SQL Browser.
It's telling you exactly what's wrong.
Details:Logon failed.
Great, we can't logon.
(Invalid Instance()).]Invalid
connection.
Okay. I bet we have "localhost" as part of the instance name in my connection string. Since I'm no longer on the "localhost", this obviously won't work. Let's try there first. Then perhaps it's the credentials that I'm using to query my database. Usually what I do is create a RO user that can only do selects on my db and use that for CR. If none of these are getting me close, let's try making sure that remote connections are enabled for SQLEXPRESS
Unable to connect: incorrect log on
parameters.
Ok it's definitely a connection issue.