-- 1. 创建登录账号
USE [master];
GO
CREATE LOGIN [test-user] WITH PASSWORD = 'xysu7SZ193SNX6E{{HxubPE3}vr',
DEFAULT_DATABASE = [MyPost];
;
-- 2. 创建数据库账号
USE [MyPost];
GO
create user [test-user] for login [test-user] with default_schema=dbo;
-- 3. 分配数据库权限
exec sp_addrolemember 'db_owner', [test-user]