简体   繁体   中英

How do you change the owner of an Azure database

I'm trying to make a copy of a database in Azure. This requires that the user logged in be the db_owner of the database.

Unfortunately the person who created the database has left and we don't have their login credentials and they don't remember them either.

Is there any way to change the db_owner in Azure databases?

Note: Doing EXEC sp_addrolemember 'db_owner', 'login1User' doesn't work for this as the actual owner account is needed to copy a database in Azure.

You probably want to reset the password on the server (not the database). When you click on "SQL Databases" tab on the portal, you'll go to a list of your databases. On there there will be a "Server" column. The entries in that column are hyperlinks. Click on the server you don't know the password for. on the Dashboard page for the server for the SQL Database you'll see a "Reset Administrator Password" link on the right under "quick glance".

Once you do that you can log into the management console for the database and change the logins for the database with ALTER LOGIN

ALTER AUTHORIZATION ON DATABASE::<YourDatabaseName> to [NewOwner];

To my knowledge there is no way to do this. Try looking in the former employees code for connections strings and hardcoded passwords.

You can also review this guide to see if there are any commands that may help you: Managing Databases and Logins in Windows Azure SQL Database

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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