Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create database 'AzureStorageEmulatorDb56' : The login already has an account under a different user name. #742

Closed
jphellemons opened this issue Jul 23, 2018 · 5 comments

Comments

@jphellemons
Copy link

@jphellemons jphellemons commented Jul 23, 2018

I have upgraded the Azure Storage Emulator from 5.4 to 5.6 and have 3 db's on my localDB:

  • AzureStorageEmulatorDb45
  • AzureStorageEmulatorDb54
  • AzureStorageEmulatorDb56

I have ran start, init and found the /forceCreate flag in the docs. Here is the output of the init /forceCreate:

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator.exe init /forceCreate
Windows Azure Storage Emulator 5.6.0.0 command line tool
Found SQL Instance (localdb)\MSSQLLocalDB.
Creating database AzureStorageEmulatorDb56 on SQL instance '(localdb)\MSSQLLocalDB'.
Granting database access to user SURFACEPRO3\myuser.
Cannot create database 'AzureStorageEmulatorDb56' : The login already has an account under a different user name.
Changed database context to 'AzureStorageEmulatorDb56'..
One or more initialization actions have failed. Resolve these errors before attempting to run the storage emulator again.
Error: Cannot create database 'AzureStorageEmulatorDb56' : The login already has an account under a different user name.
Changed database context to 'AzureStorageEmulatorDb56'..

storage-emulator

the surfacepro3\myuser is somehow desktop-f5mhl1v\myuser in the screenshot. Adding a new user to the AzureStorageEmulatorDb56 and browse to the desktop-f5mhl1v\myuser login does not work. Still says: this user already has a different login. 15063 or something.

That SQL error gave me https://www.sqlservercentral.com/Forums/Topic891149-391-1.aspx but I have no idea what user to fix, add, remove. Also have no idea if an issue on GitHub is the best approach for Azure Storage Emulator support.

@rickle-msft
Copy link
Member

@rickle-msft rickle-msft commented Jul 23, 2018

Hi, @jphellemons.

Thank you for raising this issue. I have added it to our backlog for further evaluation.

Loading

@jeroenlandheer
Copy link

@jeroenlandheer jeroenlandheer commented Oct 15, 2018

I had this same issue here.

  • Enable the SA account on the server (and set a password)
  • Login with the SA account
  • Change any databases you own with the old account to the SA account
  • Close/kill any sessions you have open with your windows account
  • Remove the old account
  • Create the same account with the new name
  • Assign sysadmin rights
  • Change the databases you own back to the new account
  • Disable the SA account

... it's a bit of a hassle, but it works

(In my case my username was changed)

Loading

@nibblesnbits
Copy link

@nibblesnbits nibblesnbits commented Dec 3, 2018

Is there any movement on this? I just started using this, and this issue hit me right away.

UPDATE: turns out the emulator works just fine, but I got that same error when I first started it.

Loading

@kfarmer-msft
Copy link
Contributor

@kfarmer-msft kfarmer-msft commented Mar 11, 2019

As you may have heard, we are moving to a completely new emulator. Please try it out:

https://github.com/azure/azurite

Loading

@paulsuart
Copy link

@paulsuart paulsuart commented Dec 1, 2020

Easier solution. After you receive the error, run the following against the AzureStorageEmulatorDbXXX database to change the owner:

sp_changedbowner @loginame='sa'

Then simply re-run the init command.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants