简体   繁体   English

在 Windows azure 上启动存储模拟器时出错

[英]Error while starting Storage Emulator on windows azure

I'm getting the error below while starting the storage emulator.启动存储模拟器时出现以下错误。 By mistake I deleted the mdf and log files in users/admin folder.我错误地删除了users/admin文件夹中的mdf和日志文件。 It's holding reference someplace and not allowing me to create the DB again.它在某处持有引用并且不允许我再次创建数据库。 Please help me.请帮我。

Added reservation for 127.0.0.1:10000/ in user account RaviBorra-PC\Ravi Borra.
Added reservation for 127.0.0.1:10001/ in user account RaviBorra-PC\Ravi Borra.
Added reservation for 127.0.0.1:10002/ in user account RaviBorra-PC\Ravi Borra.

Found SQL Instance (localdb)\v11.0.
Creating database DevelopmentStorageDb201206 on SQL instance '(localdb)\v11.0'.
Cannot create database 'DevelopmentStorageDb201206' : Database 'DevelopmentStorageDb201206' already exists. Choose a different database name..

One or more initialization actions have failed. Resolve these errors before attempting to run the storage emulator again. Please refer to http://go.microsoft.com/fwlink/?LinkID=248088 for more details.

Thank you, Ravi Krishna B.谢谢你,拉维克里希纳 B.

Do these steps:执行以下步骤:

  1. Open cmd.exe (Command Prompt)打开 cmd.exe(命令提示符)
  2. Write this:写这个:

     SqlLocalDb stop "v11.0" SqlLocalDb delete "v11.0"

    and press Enter然后按Enter

Note that "v11.0" is MyInstance .请注意,“v11.0”是MyInstance

For more details, visit this link .有关更多详细信息,请访问此链接

This problem may occur if you delete the data file C:\\Users\\<Username>\\DevelopmentStorageDb201206.mdf but do not delete the corresponding database on the LocalDB server instance.如果您删除了数据文件C:\\Users\\<Username>\\DevelopmentStorageDb201206.mdf但没有删除 LocalDB 服务器实例上的相应数据库,则可能会出现此问题。 One possible solution is:一种可能的解决方案是:

  1. Connect to the (localdb)\\v11.0 instance from SQL Server Management Studio .SQL Server Management Studio连接到(localdb)\\v11.0实例。
  2. Delete the DevelopmentStorageDb201206 database.删除DevelopmentStorageDb201206数据库。 There will be the error message that the database deletion ended with an error.会出现数据库删除以错误结束的错误信息。 Ignore this message and refresh the database list manually.忽略此消息并手动刷新数据库列表。
  3. Now you can start the Azure Storage Emulator.现在可以启动 Azure 存储模拟器。

This is not a problem related with Azure components rather LocalDB instance is reporting back to Azure request that DB still exist.这不是与 Azure 组件相关的问题,而是 LocalDB 实例向 Azure 请求报告 DB 仍然存在。 Check LocalDB instances in your machine using "sqllocaldb i" first and the delete the instance using "sqllocaldb d 'instance_name'".首先使用“sqllocaldb i”检查机器中的LocalDB实例,然后使用“sqllocaldb d 'instance_name'”删除实例。 I could not test it in my machine but this may unblock you if localdb instance is blocking you.我无法在我的机器上测试它,但是如果 localdb 实例阻止了你,这可能会解除对你的阻止。

In Windows Azure SDK 1.7, Windows Azure Storage Emulator uses LocalDB instance specific configuration at following location:在 Windows Azure SDK 1.7 中,Windows Azure Storage Emulator 在以下位置使用 LocalDB 实例特定的配置:

%LocalAppData%\DevelopmentStorage\DevelopmentStorage.201206.config

And based on that you will see that v11.0 instance is Windows Azure Storage Emulator specific so verify if that is running and deleting it will let DSInit to create the DB again in LocalDB.基于此,您将看到 v11.0 实例是特定于 Windows Azure 存储模拟器的,因此请验证它是否正在运行并删除它会让 DSInit 在 LocalDB 中再次创建数据库。

If you have Sql Express installed on your local box then (localdb)\\v11.0 is most likely not your local Sql instance.如果您在本地机器上安装了 Sql Express,那么 (localdb)\\v11.0 很可能不是您的本地 Sql 实例。 It is more likely {MyComputerName}\\SQLEXPRESS.它更有可能是 {MyComputerName}\\SQLEXPRESS。

Going to:正在去:

C:\Users\<yourloginname>\AppData\Local\DevelopmentStorage\DevelopmentStorage.201206.config

And changing:并改变:

 <SQLInstance>(localdb)\v11.0</SQLInstance>

To:到:

<SQLInstance>{MyComputerName}\SQLEXPRESS</SQLInstance>

solved this error for me.为我解决了这个错误。

I hope this helps..我希望这有帮助..

If you already tried and failed perform:如果您已经尝试并失败,请执行:

 SQLLocalDB stop v11.0
 SQLLocalDB delete v11.0
 Delete all the files in C:\Users\<accontname>\WAStorageEmulatorDb* (usually one mdf and one ldf)
 Create a new account (I called it Azure, with administrative rights)
 Run again the installation
 Installation completed!

For me this works... I had tried to format the PC before use this way.对我来说这有效......我曾尝试在使用这种方式之前格式化PC。 I supposte my problem is related to my username that contains "invalid" characters like Name 'NickName' Surname while the "Azure" account seems to be OK for him.我认为我的问题与我的用户名有关,其中包含“无效”字符,例如 Name 'NickName' Surname 而“Azure”帐户对他来说似乎没问题。

I figure it out 'cause somewhere in the log I have a property destination path set to "C:\\Users\\Name$_" that is far away for the path of my user account folder.我弄清楚了,因为在日志中的某个地方,我将属性目标路径设置为“C:\\Users\\Name$_”,这与我的用户帐户文件夹的路径相距甚远。

After that you can go on CMD.exe and prompt:之后你可以继续 CMD.exe 并提示:

 control userpasswords2

From the control you can delete the Azure login without delete the file folders!从控件中您可以删除 Azure 登录而不删除文件夹!

Hope it helps!希望能帮助到你!

I simply deleted all the mdf's and ldf's in C:\\Users\\accountname\\ that started with DevelopmentStorage... or WAStorageEmulator.我只是删除了 C:\\Users\\accountname\\ 中以 DevelopmentStorage... 或 WAStorageEmulator 开头的所有 mdf 和 ldf。

Re-ran the install and it worked.重新运行安装,它起作用了。

This can also be caused by the folder not existing for localDB.这也可能是由 localDB 不存在的文件夹引起的。 It looks like Visual Studio / Azure will not automatically create containing folders.看起来 Visual Studio/Azure 不会自动创建包含文件夹。 I just copied the path from the error code into explorer and created the directory up to the .MDF file.我只是将错误代码中的路径复制到资源管理器中,并创建了 .MDF 文件的目录。

在 Visual Studio 中,转到工具 -> 选项 -> 数据库工具 -> 数据连接并将 localdb 实例名称从 v11.0 更改为其他名称。

I did have SQL Express installed, as Brian Ogden suggested in his answer, but I wanted to try & point Azure Storage Emulator to my SQL Express instance without modifying configuration files.正如 Brian Ogden 在他的回答中所建议的那样,我确实安装了 SQL Express,但我想尝试将 Azure Storage Emulator 指向我的 SQL Express 实例,而无需修改配置文件。

I did this by running the initialization process for Storage Emulator & passing my server\\instance details for SQL Express using the available switches.我通过运行 Storage Emulator 的初始化过程并使用可用的开关为 SQL Express 传递我的服务器\\实例详细信息来做到这一点。 Below example of the command I executed (from an elevated command prompt):下面是我执行的命令示例(来自提升的命令提示符):

AzureStorageEmulator.exe init -server MY-PC-NAME -instance MYSQLINST

This created the database successfully (in my SQL Express instance) & got my Storage Emulator working.这成功创建了数据库(在我的 SQL Express 实例中)并让我的存储模拟器工作。

I am using a named instance, but I'm thinking this same approach can be used for default instances by omitting the -instance switch.我正在使用命名实例,但我认为通过省略-instance开关,可以将相同的方法用于默认实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM