Error occurred during localdb instance startup sql server process failed to start

KB5003342 — FIX: SQL Server Express LocalDB can’t start or connect to shared instances of SQL Server Express LocalDB 2019 or 2017 Symptoms Assume that you use the SqlLocalDB feature in Microsoft SQL Server 2019 or 2017. In this situation, you can’t start correctly or connect to a shared instance of SqlLocalDB. Resolution This […]

Содержание

  1. KB5003342 — FIX: SQL Server Express LocalDB can’t start or connect to shared instances of SQL Server Express LocalDB 2019 or 2017
  2. Symptoms
  3. Resolution
  4. Status
  5. More information
  6. References
  7. Справочник по SQL Server Express LocalDB — сообщения об ошибках
  8. Sql localdb connection error
  9. Answered by:
  10. Question
  11. Sql localdb connection error
  12. Answered by:
  13. Question
  14. Sql localdb connection error
  15. Answered by:
  16. Question

KB5003342 — FIX: SQL Server Express LocalDB can’t start or connect to shared instances of SQL Server Express LocalDB 2019 or 2017

Symptoms

Assume that you use the SqlLocalDB feature in Microsoft SQL Server 2019 or 2017. In this situation, you can’t start correctly or connect to a shared instance of SqlLocalDB.

Resolution

This problem is fixed in the following cumulative updates for SQL Server:

Each new cumulative update for SQL Server contains all the hotfixes and security fixes that were in the previous build. We recommend that you install the latest build for your version of SQL Server:

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.

More information

This issue occurs when you try to connect to a shared instance of LocalDB.

REM Create named instance FOO

SqlLocalDB.exe create FOO

REM Run the following command from an elevated command prompt

REM Share instance FOO as FOOSHARED

SqlLocalDB.exe share FOO FOOSHARED

When you run the following command, you may receive an error message as shown below:

SqlCmd.exe -S (localdb).FOOSHARED -E

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server [2]. .

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : 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..

References

Learn about the terminology that Microsoft uses to describe software updates.

Источник

Справочник по SQL Server Express LocalDB — сообщения об ошибках

Применимо к: SQL Server (все поддерживаемые версии)

Этот раздел содержит справочные сведения о следующих сообщениях об ошибках SQL Server Express LocalDB:

LOCALDB_ERROR_ADMIN_RIGHTS_REQUIRED
Для выполнения этой операции требуются права администратора.

LOCALDB_ERROR_AUTO_INSTANCE_CREATE_FAILED
Невозможно создать автоматический экземпляр. Сведения об ошибке см. в журнале событий приложений Windows.

LOCALDB_ERROR_CALLER_IS_NOT_OWNER
Вызывающий API не является владельцем экземпляра LocalDB.

LOCALDB_ERROR_INSTANCE_ALREADY_SHARED
Указанный экземпляр уже используется совместно.

LOCALDB_ERROR_INSTANCE_EXISTS_WITH_LOWER_VERSION
Указанный экземпляр уже существует, но его версия ниже запрошенной.

LOCALDB_ERROR_INSTANCE_FOLDER_PATH_TOO_LONG
Длина пути к месту хранения экземпляра больше MAX_PATH.

LOCALDB_ERROR_INSTANCE_STOP_FAILED
Операцию остановки не удалось завершить в течение заданного времени.

LOCALDB_ERROR_INSUFFICIENT_BUFFER
Размер входного буфера является недостаточным, а усечение не было запрошено.

LOCALDB_ERROR_INTERNAL_ERROR
Произошла непредвиденная ошибка. Подробные сведения см. в журнале событий.

LOCALDB_ERROR_INVALID_PARAMETER
Один или несколько указанных входных параметров недопустимы.

LOCALDB_ERROR_NOT_INSTALLED
Компонент SQL Server Express LocalDB не установлен на компьютере.

LOCALDB_ERROR_SQL_SERVER_STARTUP_FAILED
Был запущен процесс SQL Server, но запуск SQL Server завершился с ошибкой.

LOCALDB_ERROR_WAIT_TIMEOUT
При попытке получения блокировок синхронизации истекло время ожидания.

LOCALDB_ERROR_XEVENT_FAILED
Не удалось запустить подсистему XEvent в API экземпляра LocalDB.

Источник

Sql localdb connection error

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

I have installed SQL 2012 and LocalDB on my development machine, and am able to connect to LocalDB using both the SQL Server Management tool 2012 and from within my winform application using a newly modifed connection string Shown below:

Data Source=(LocalDB)v11.0;AttachDbFilename=|DataDirectory|MyDatabase.mdf;Integrated Security=True;Connect Timeout=60

the problem arises when I attempt to port my appliation onto a Windows 2008 Server which is running SQL Server 2008, ( I know I could skip the LocalDB installation and just make use of Sql 2008, but I am just testing the installation of my application on this machine.. )

I have installed both SQL Server 2012 LocalDB and updated .net 4.01 to .net 4.02 using the kb article located at http://support.microsoft.com/kb/2544514

I keep getting getting an error when I attempt to connect to (LocalDB)v11.0 from both my application and from the SQL Management 2008 Tool, I have also manually started up (LocalDB)v11.0 from cmd->SQLLocalDB -s «v11.0» and then attempted to connect once again using the NP

When I use thre named pipe everything connects fine, so I am assuming that as this works then the installation of LocalDB is also correct.

What do you suggest I do to resolve this situation?

I am also concerned as to the proper impllmentation moving forward with the deployment of my application, am I supposed to now include .Net 4.03 as a prerequisite? id so is there already a clickonce bootstrap manifest available for this or do I need to create one..so that my app works correctly moving forward, I’m really concerned that LocalDB might break it.. as so far I’m not having much luck..

I guess if all else fails I can go back to using Sql Express 2008 as this implmentation worked correctly before..

Источник

Sql localdb connection error

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

I can’t connect to LocalDB using Visual Studio for Web Express 2012 or SMSS 2012 in a Windows 8 environment. LocalDB is installed and some things do work, however. The basic error is the very common:

Cannot connect to (LocalDB)v11.0.

——————————
ADDITIONAL INFORMATION:

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: 50 — Local Database Runtime error occurred. Error occurred during LocalDB instance startup: SQL Server process failed to start.

In a command window, I can query the state of LocalDB an «info» parameter:

C:Program FilesMicrosoft SQL Server110ToolsBinn>sqlLocalDB info
SportsStore
TestOfLoc
v11.0

The first two are tests created at the command line using sqlLocalDB.

I have reinstalled and repaired LocalDB several times with no errors reported.

As a further demonstration of the problem, I’ve included the login screen error.

Источник

Sql localdb connection error

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

I can’t connect to LocalDB using Visual Studio for Web Express 2012 or SMSS 2012 in a Windows 8 environment. LocalDB is installed and some things do work, however. The basic error is the very common:

Cannot connect to (LocalDB)v11.0.

——————————
ADDITIONAL INFORMATION:

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: 50 — Local Database Runtime error occurred. Error occurred during LocalDB instance startup: SQL Server process failed to start.

In a command window, I can query the state of LocalDB an «info» parameter:

C:Program FilesMicrosoft SQL Server110ToolsBinn>sqlLocalDB info
SportsStore
TestOfLoc
v11.0

The first two are tests created at the command line using sqlLocalDB.

I have reinstalled and repaired LocalDB several times with no errors reported.

As a further demonstration of the problem, I’ve included the login screen error.

Источник

Please note: this solution is considered to be obsolete

Errors:

Code: Select all

Error occurred during LocalDB instance startup: SQL Server process failed to start 

Veeam.Backup.Common.CSqlException: Microsoft SQL server hosting the configuration database is currently unavailable. Possible reasons are heavy load, networking issue, server reboot, or hot backup.
Please wait, and try again later. 

Preparation:

1. Before you go, check:
— Your antivirus is not blocking the installation process.
— Microsoft SQL Server 2012 Express LocalDB is installed. If you have any installation issues — the best option is to install the version included in the setup
— SYSTEM accout has full access permissions to systemprofile folder C:WindowsSystem32configsystemprofile

2. Download, install and open PS Tools:
— Download PSTools: http://download.sysinternals.com/files/PSTools.zip
— Install it, for ease of use it could be unpacked to C:PSTools
— Go to Run > cmd as administrator
— cd C:PSTools (or the folder you used for during unpacking)
— Run PsExec.exe –i –s cmd.exe (accept the user agreement message may pop up )
3. Uninstall Veeam Endpoint Backup BETA via Control Panel > Programs and Features

Resolutions:

Case A: Instance was corrupted during setup and must be deleted:

1. Download, install and open PS Tools like described in preparation step 2
2. Delete corrupted instance by typing the following commands in PS Tools command prompt:

Code: Select all

whoami 
//Response nt authoritysystem
 “C:Program FilesMicrosoft SQL Server110ToolsBinnSqlLocalDB.exe” delete VeeamEndPoint 
//Response: “LocalBD instance “VeeamEndPoint” deleted”

3. Reboot and to install Veeam Endpoint Backup.

Case B: The Case A solution did not help. Instance creation continues to fail during Endpoint setup.

1. Install the following components (reboot if required for each component):
— Microsoft System CLR Types for SQL Server 2012 (is included in Endpoint setup)
— Microsoft SQL Server 2012 Management Objects (is included in Endpoint setup)
— Microsoft SQL Server 2012 Express LocalBD (is included in Endpoint setup)
— Microsoft SQL Server 2012 Native Client
— Microsoft SQL Server 2012 Command Line Utilities

2. Add the following string values for SQL instance login/password in the registry via regedit.exe

Code: Select all

 HKEY_LOCAL_MACHINESOFTWAREVeeamVeeam Endpoint Backup
//the following string values generated by QA
"SqlLogin"="VeeamLogin"
"SqlPassword"="75f00cdb-d8db-45ab-8024-8cc576df15b1"

3. Download, install and open PS Tools like described in preparation step 2
4. Re create the instance by typing the following commands in PS Tools command prompt:

Code: Select all

 whoami 
//Response nt authoritysystem
 “C:Program FilesMicrosoft SQL Server110ToolsBinnSqlLocalDB.exe” delete VeeamEndPoint 
//Response: “LocalBD instance “VeeamEndPoint” deleted”
SqlLocalDB create VeeamEndPoint 
//Response: “LocalBD instance “VeeamEndPoint” created with version 11.0.”
SqlLocalDB start VeeamEndPoint 
//Response: “LocalBD instance “VeeamEndPoint” started”
SqlLocalDB info VeeamEndPoint 
//Response example (12345678 is an example – you will have other output): “Instance pipe name: np:\.pipeLOCALDB#12345678tsqlquery”
//Copy np:\.pipeLOCALDB#12345678tsqlquery from the previous query
sqlcmd -S np:\.pipeLOCALDB#12345678tsqlquery 
// Command prompt cursor will change to 1>
// Type in each line and hit enter one by one
USE [master]
GO
CREATE LOGIN [VeeamLogin] WITH PASSWORD=N'75f00cdb-d8db-45ab-8024-8cc576df15b1', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
EXEC master..sp_addsrvrolemember @loginame = N'VeeamLogin', @rolename = N'sysadmin'
GO
EXIT
// Command prompt cursor revert back to normal 
SqlLocalDB stop VeeamEndPoint 
// Response “LocalBD instance “VeeamEndPoint” stopped”

Additionally:
— Microsoft SQL Server 2012 Native Client and Microsoft SQL Server 2012 Command Line Utilities can be found here: http://www.microsoft.com/en-US/download … x?id=29065

If the LocalDB and sqlcmd fail:
During LocalDB and sqlcmd installation path variables are automatically pushed into the system. If SqlLocalDB or sqlcmd commands fail, you may need to type a full path instead:
— SqlLocalDB should be replaced by “%Program Files%Microsoft SQL Server110ToolsBinnSqlLocalDB.exe” (with quotes)
— sqlcmd should be replaced by “%Program Files%Microsoft SQL Server110ToolsBinnSqlCmd.exe” (with quotes)

Still having installation issues?
Collect and share:
— The full setup logs from C:ProgramDataVeeam
— Windows Event logs from windows event viewer (Custom View > Administrative events)
— LocalDB error log from %systemroot%system32configsystemprofileAppDataLocalMicrosoftMicrosoft SQL Server Local DBInstancesVeeamEndPoint (it should look like error.log, error1.log, error2.log etc)
— Pack and send it via any available cloud storage (Dropbox/Google Drive/OneDrive etc)
— Ping me via PM or posting to this thread

Sorry about the previous Windows 2010! I meant Windows 10 — it had been a long day!

I was lucky enough to go to a site today where this issue is happening. I have a work around which I detail below, but it is an interesting issue.

Background

I have about 500 users using a system that runs on Windows. It utilises a SQL 2012 Local DB as a data repository. I have two users with the above problem. Both users are running Windows 10 32 bit. Both have recently upgraded from Windows 7. At least one of these users had no issues before upgrade.

Issue

As part of the launching of the system I use a .Net EXE to verify that all the components are in place and working OK. One of the functions that this EXE calls is: —

Private Function CheckLocalDBConnection() As Boolean

Dim connetionString As String

Dim cnn As SqlConnection

Try

connetionString = «Data Source=(LocalDB)InstanceName;Initial Catalog=Master;User ID=SQLUser;Password=*******»

cnn = New SqlConnection(connetionString)

cnn.Open()

cnn.Close()

CheckLocalDBConnection = True

Catch

CheckLocalDBConnection = False

End Try

End Function

This function tries to get a connection to the LocalDB. As per the Microsoft documentation, this first connection also starts the instance.

On these two machines, the starting of the instance fails with the error that the Model, Resources etc can be accessed due to them being hosted on some spurious E drive.

Investigation

If I create and start the instance via a batch file, the above code works fine. It is only starting the instance (through initial first connection) via the .Net EXE that is causing the issue.

I have created a new user, uninstalled local db, reinstalled local db, all with the same error.

Work around

I changed the desktop shortcut to point to a batch file. The batch file now starts the instance before calling the EXE. This works and resolves the issue for the end user.

My thoughts

I think the error is erroneous and actually points to a permission issue between the .Net exe and the LocalDB Instance. We have not yet got to the point of connecting to the instance (although the code above is a connection). The error log is showing that the instance is failing to start.

I cannot recreate the issue on any equipment that I own so I have limited scope to investigate further. However, I am posting this just in case someone else has the same issue…

I have a project that contains SQL localDB(v11.0).When I run on m PC it runs perfectly, but when I run it on other pc I get this error. I am Using Visual Studio 2013

—————————————————————
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: 50 — Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.
—————————————————————

My connection String in App.config file is
——————————————————
connectionString=»Data Source=(LocalDB)v11.0;AttachDbFilename=|DataDirectory|EMSDB.mdf;Integrated Security=True»
——————————————————————————

Comments


Solution 1

«LocalDB» means «on this computer» — so if you have moved your code to a different PC, then you need to change the connection string to refer to the computer with the production SQL server instance installed on it.

This should not be the computer you develop software on — never, ever test code against production databases, unless you really like looking for new jobs quickly — and you shouldn’t automatically install SQL server on every PC with your software.

Comments

Solution 2

You need to update your connection string to match whatever is installed on that server or change it to point back to your computer that does have SQL installed on it.

Comments

Solution 3

You need to install LocalDB on the computer which will be using it; you can’t simply copy the files to the computer and run the application.

The primary method of installing LocalDB is by using the SqlLocalDB.msi program. LocalDB is an option when installing any SKU of SQL Server 2012 Express. Select LocalDB on the Feature Selection page during installation of SQL Server Express. There can be only one installation of the LocalDB binary files for each major SQL Server Database Engine version. Multiple Database Engine processes can be started and will all use the same binaries. An instance of the SQL Server Database Engine started as the LocalDB has the same limitations as SQL Server Express

Download the SQLLocalDB.msi file from the SQL Express download page[^] and install it on the target computer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

 

Print

Answers RSS

Top Experts
Last 24hrs This month

CodeProject,
20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8
+1 (416) 849-8900

Понравилась статья? Поделить с друзьями:
  • Error occurred during initialization of vm что делать
  • Error occurred during initialization of vm майнкрафт
  • Error occurred during initialization of vm too small maximum heap
  • Error occurred during initialization of vm too small initial heap
  • Error occurred during initialization of vm minecraft