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

时间:2018-04-19 19:48:08

标签: azure sql-server-2017 azure-storage-emulator

我正在设置开发人员图片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一起使用吗?

2 个答案:

答案 0 :(得分:1)

这有效(注意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中选择了这个。

答案 1 :(得分:1)

强制在本地主机上创建数据库:

开始-> Microsoft Azure存储命令行

cd "Storage Emulator"
AzureStorageEmulator init -sqlinstance . -forcecreate
AzureStorageEmulator start