gpt4 book ai didi

Azure 存储模拟器无法在 MSSQLLocalDB 实例中创建 "AzureStorageEmulatorDb53"

转载 作者:行者123 更新时间:2023-12-03 19:35:24 24 4
gpt4 key购买 nike

我正在设置 Azure 开发人员镜像。

我安装了最新的 Azure 存储模拟器 (v5.3),然后安装了 SQL Server 2017。

Azure 存储模拟器无法创建数据库。以下是日志:

c:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>sqllocaldb i
MSSQLLocalDB

c:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator.exe init
Windows Azure Storage Emulator 5.3.0.0 command line tool
Found SQL Instance (localdb)\MSSQLLocalDB.
Creating database AzureStorageEmulatorDb53 on SQL instance '(localdb)\MSSQLLocalDB'.
Cannot create database 'AzureStorageEmulatorDb53' : The database 'AzureStorageEmulatorDb53' does not exist. Supply a valid database name. To see available databases, use sys.databases..
One or more initialization actions have failed. Resolve these errors before attempting to run the storage emulator again.
Error: Cannot create database 'AzureStorageEmulatorDb53' : The database 'AzureStorageEmulatorDb53' does not exist. Supply a valid database name. To see available databases, use sys.databases..

c:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>sqllocaldb v
Microsoft SQL Server 2017 (14.0.1000.169)

模拟器 v5.3 不适用于服务器 2017 吗?

最佳答案

这有效(注意 powershell):

Invoke-WebRequest https://download.microsoft.com/download/9/0/7/907AD35F-9F9C-43A5-9789-52470555DB90/ENU/SqlLocalDB.msi -OutFile SqlLocalDB.msi

msiexec /i SqlLocalDB.msi /qn /norestart IACCEPTSQLLOCALDBLICENSETERMS=YES

Invoke-WebRequest http://download.microsoft.com/download/1/F/C/1FCF23A3-BBD8-4F50-B5C2-E382F14A2AAD/MicrosoftAzureStorageEmulator.msi -OutFile MicrosoftAzureStorageEmulator.msi

msiexec /i MicrosoftAzureStorageEmulator.msi /qn

Remove-Item -Force *.msi

setx /M AZ_STOR_EMU_HOME "%ProgramFiles(x86)%\Microsoft SDKs\Azure\Storage Emulator"

setx /M PATH "%PATH%;%AZ_STOR_EMU_HOME%"

cd "C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator"

Start-Process -FilePath "AzureStorageEmulator.exe" -ArgumentList "init"

上述脚本将使用 Microsoft SQL Server 2016 LocalDB 和 Microsoft Azure Storage Emulator v5.3。现在模拟器已正确初始化。

我从 dockerfile found here 中找到了这个.

关于Azure 存储模拟器无法在 MSSQLLocalDB 实例中创建 "AzureStorageEmulatorDb53",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49929120/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com