[英]How to Configure Azure Storage Emulator to work with local SQLServer
I am trying to configure Azure Storage Emulator 2.4 work with Local SQL server 2012. 我正在尝试使用Local SQL server 2012配置Azure存储模拟器2.4。
When I execute this command, I get cannot create Database. 执行此命令时,无法创建数据库。
C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>WAStorageEmulator.exe init -server ThisPC -sqlinstance SQLEXPRESS -forcecreate
Windows Azure Storage Emulator 3.3.0.0 command line tool
Error: Cannot create database.
To my Sql Sever Manager I login using server name ThisPC\\SQLEXPRESS. 到我的Sql Sever Manager我使用服务器名称ThisPC \\ SQLEXPRESS登录。
Please help me on which information i have missed. 请帮我告诉我错过了哪些信息。
----------------- Updated ----------------- - - - - - - - - - 更新 - - - - - - - - -
C:\\Program Files (x86)\\Microsoft SDKs\\Azure\\Storage Emulator>WAStorageEmulator.exe init -server (local)\\SQLExpress -forcecreate
Windows Azure Storage Emulator 3.3.0.0 command line tool Error: Cannot create database.
Windows Azure存储模拟器3.3.0.0命令行工具错误:无法创建数据库。
If you look at AppData\\Local\\WAStorageEmulator\\WAStorageEmulator.3.3.config you'll find: 如果查看AppData \\ Local \\ WAStorageEmulator \\ WAStorageEmulator.3.3.config,您将找到:
<SQLInstance>(local)\SQLExpress</SQLInstance>
Thanks to Gaurav on reminding me on logs, I checked my Event Viewer: 感谢Gaurav提醒我日志,我检查了我的事件查看器:
Cannot create file 'C:\\Program Files\\Microsoft SQL Server\\MSSQL10.SQLEXPRESS\\MSSQL\\DATA\\WAStorageEmulatorDb33.mdf' because it already exists
无法创建文件'C:\\ Program Files \\ Microsoft SQL Server \\ MSSQL10.SQLEXPRESS \\ MSSQL \\ DATA \\ WAStorageEmulatorDb33.mdf',因为该文件已存在
It said the SQL DB files exists, so deleted it and retried the command, worked fine and storage emulator also started. 它说SQL DB文件存在,因此删除了该文件并重试了该命令,工作正常,并且存储模拟器也已启动。 (command worked second attempt after some time might be some SQL cache issue)
(命令在一段时间后第二次尝试可能是某些SQL缓存问题)
I would like to propose an answer based on the information from the OP's post/comments for readers from the future who get here after a some searching. 我想基于OP的帖子/评论中的信息提出一个答案,这些信息来自未来的读者,经过一些搜索后会到达这里。
It is quite easy, and really the main piece of pertinent information is that you must first delete the existing database file located at: 这很容易,并且实际上相关的主要信息是您必须首先删除位于以下位置的现有数据库文件:
C:\\Users\\\\WAStorageEmulatorDb33.mdf
C:\\用户\\\\ WAStorageEmulatorDb33.mdf
Then you can reinitialize the emulator. 然后,您可以重新初始化仿真器。 So run the Azure Storage Emulator and initialize it with your desired SQL instance:
因此,运行Azure存储模拟器并使用所需的SQL实例对其进行初始化:
WAStorageEmulator.exe init -server (local)\\SQLExpress
WAStorageEmulator.exe init -server(本地)\\ SQLExpress
Things that can go wrong: 可能出错的事情:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.