domingo, 24 de outubro de 2021

Creating user to acess SQL databases on Azure

 

Open Azure Data Studio and execute these commands:

-- create login credentials on the server
USE master;
CREATE LOGIN user_name WITH password='p455w0rd';
GO

-- create user on the database
USE DATABASE_NAME;
CREATE USER user_name FROM LOGIN user_name;
GO

-- grant permission for user
USE DATABASE_NAME;
EXEC sp_addrolemember 'db_datareader''user_name';
EXEC sp_addrolemember 'db_datawriter''user_name';
EXEC sp_addrolemember 'db_backupoperator''user_name';
GO

Postgres no docker

 -- Criar compose nano docker-compose.yml version: '3.7' ### services:   db:     image: postgres     volumes:       - postgres_data:...