use[master]go
--建立使用者,test,密碼test
create login [
testuser
]with password=n'
test
', default_database=
[master
], check_expiration=
off, check_policy=
offgo
--設定test使用者可以建立任意資料庫
grant
create
anydatabaseto[
test]go
--將所有資料庫的檢視許可權給public角色,每個登入使用者只能檢視指定的資料庫
--此語句會導致伺服器上所有的使用者在沒有設定資料庫許可權的情況下不會顯示任何資料庫,有可能會影響正常使用
deny
view
anydatabase
topublic;go
--將資料庫test的所有權給testuser使用者
--testuser使用者可以檢視並訪問test資料庫
alter
authorization
ondatabase::testdb to
testuser
go
SQL SERVER 檢視使用者許可權
使用者與角色關係 select a.uid as uid,a.status as ustatus,a.name as uname,b.uid as rid,b.status as rstatus,b.name as rname from sysusers a left join sysmembers...
mysql許可權操作 MYSQL使用者及許可權操作
在cmd中操作mysql 步驟 net start mysql 啟動服務 mysql uroot ppassward 登入資料庫 mysql h127.0.0.1 uroot p 登入遠端主機 exit 退出登入 net stop mysql 關閉服務 常見問題 啟動服務提公升 服務名無效 輸入se...
sql server 使用者訪問許可權設定
示例說明 示例在資料庫pubs中建立乙個擁有表jobs的所有許可權 擁有表titles的select許可權的角色r test 隨後建立了乙個登入l test,然後在資料庫pubs中為登入l test建立了使用者賬戶u test 同時將使用者賬戶u test新增到角色r test中,使其通過許可權繼承...