當前位置:首頁 » 編程語言 » sql錯誤401
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

sql錯誤401

發布時間: 2022-12-09 16:05:14

❶ 進入sql資料庫提示未授權

sql語言用grant語句向用戶授予操作許可權,grant語句的一般格式為:
grant
<許可權>[,<許可權>]...
[on
<對象類型>
<對象名>]
to
<用戶>[,<用戶>]...
[with
grant
option];
其語義為:將對指定操作對象的指定操作許可權授予指定的用戶。
不同類型的操作對象有不同的操作許可權,常見的操作許可權如表3-4所示。
表3-4
不同對象類型允許的操作許可權
對象
對象類型
操作許可權
屬性列
table
select,
insert,
update,
delete
all
privieges
視圖
table
select,
insert,
update,
delete
all
privieges
基本表
table
select,
insert,
update,
alter,
index,delete
all
privieges
資料庫
database
createtab
詳細信息…
接受許可權的用戶可以是一個或多個具體用戶,也可以是public即全體用戶。
如果指定了with
grant
option子句,則獲得某種許可權的用戶還可以把這種許可權再授予別的用戶。如果沒有指定with
grant
option子句,則獲得某種許可權的用戶只能使用該許可權,但不能傳播該許可權。
例1
把查詢student表許可權授給用戶u1
grant
select
on
table
student
to
u1;
例2
把對student表和course表的全部許可權授予用戶u2和u3
grant
all
priviliges
on
table
student,
course
to
u2,
u3;
例3
把對表sc的查詢許可權授予所有用戶
grant
select
on
table
sc
to
public;
例4
把查詢student表和修改學生學號的許可權授給用戶u4
詳細信息…
這里實際上要授予u4用戶的是對基本表student的select許可權和對屬性列sno的update許可權。授予關於屬性列的許可權時必須明確指出相應屬性列名。完成本授權操作的sql語句為:
grant
update(sno),
select
on
table
student
to
u4;
例5
把對表sc的insert許可權授予u5用戶,並允許他再將此許可權授予其他用戶
grant
insert
on
table
sc
to
u5
with
grant
option;
詳細信息…
執行此sql語句後,u5不僅擁有了對表sc的insert許可權,還可以傳播此許可權,即由u5用戶發上述grant命令給其他用戶。
例如u5可以將此許可權授予u6:
grant
insert
on
table
sc
to
u6
with
grant
option;
同樣,u6還可以將此許可權授予u7:
grant
insert
on
table
sc
to
u7;
因為u6未給u7傳播的許可權,因此u7不能再傳播此許可權。
例6
dba把在資料庫s_c中建立表的許可權授予用戶u8
grant
createtab
on
database
s_c
to
u8;

❷ 安裝SQL server時出現錯誤提醒,求大神解決

這應該是操作系統問題(既windows系統問題),你可以試試以下方法,再重新安裝。
開始==》運行==》services.msc==》找到windows installer service 先禁用 重啟系統以後再啟用

如果仍然出現相同問題,建議你重新安裝windows

❸ 在與 SQL Server 建立連接時出現 error: 40

一般有如下情況:
1、在SQL Server外圍配置應用器查看遠程資料庫伺服器遠程連接是否開啟;
2、查看防火牆是否禁用了1433和1434埠;
3、在SQL Server Configuration Manager 中查看資料庫是否是禁用了tcp/ip連接;