大家好,我是考100分的小小码 ,祝大家学习进步,加薪顺利呀。今天说一说数据库中,限制用户只能访问一个数据库怎么办_数据库用户sa登录失败,希望您对编程的造诣更进一步.
USE master;
GO
--Step 1: (create a new user)
create LOGIN hello WITH PASSWORD="foo", CHECK_POLICY = OFF;
-- Step 2:(deny view to any database)
USE master;
GO
DENY VIEW ANY DATABASE TO hello;
-- step 3 (then authorized the user for that specific database , you have to use the master by doing use master as below)
USE master;
GO
ALTER AUTHORIZATION ON DATABASE::yourDB TO hello;
GO
代码100分
https://stackoverflow.com/questions/4085700/restrict-sql-server-login-access-to-only-one-database
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/8988.html