Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

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

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
Contributor

Hi, @jphellemons.

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

@jeroenlandheer
Copy link

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)

@nibblesnbits
Copy link

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.

@kfarmer-msft
Copy link
Contributor

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

https://github.com/azure/azurite

@paulsuart
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants