mysql5.1 的GRANT语句问题
我在输入GRANTPRIVILEGESONSTUDENT,SCTOU1@LOCALHOST时系统说STUDENT,SC处有语法错误,然后在输入GRANTSELECTONS...
我在输入GRANT PRIVILEGES ON STUDENT,SC TO U1@LOCALHOST时系统说STUDENT,SC处有语法错误,然后在输入GRANT SELECT ON SC TO PUBLIC;时又说ERROR 1133:CAN'T FIND ANY MATCHING ROW IN THE USER TABLE;我是菜鸟,都是按照书上来打的,不知错在哪里,还望大家来告诉我
不是用户没创建。。。我事先创建用户再用这些语句授权的 展开
不是用户没创建。。。我事先创建用户再用这些语句授权的 展开
3个回答
展开全部
授权之前应该先建立用户,你执行下面的语句就明白了:
SELECT * FROM mysql.user;
补充:
下面是GRANT的语句说明:
GRANT priv_type [(column_list)] [, priv_type [(column_list)]] ...
ON [object_type] {tbl_name | * | *.* | db_name.*}
TO user [IDENTIFIED BY [PASSWORD] 'password']
[, user [IDENTIFIED BY [PASSWORD] 'password']] ...
[REQUIRE
NONE |
[{SSL| X509}]
[CIPHER 'cipher' [AND]]
[ISSUER 'issuer' [AND]]
[SUBJECT 'subject']]
[WITH with_option [with_option] ...]
object_type =
TABLE
| FUNCTION
| PROCEDURE
with_option =
GRANT OPTION
| MAX_QUERIES_PER_HOUR count
| MAX_UPDATES_PER_HOUR count
| MAX_CONNECTIONS_PER_HOUR count
| MAX_USER_CONNECTIONS count
不知道你的STUDENT、SC 是什么,ON后面的应该是表名。
SELECT * FROM mysql.user;
补充:
下面是GRANT的语句说明:
GRANT priv_type [(column_list)] [, priv_type [(column_list)]] ...
ON [object_type] {tbl_name | * | *.* | db_name.*}
TO user [IDENTIFIED BY [PASSWORD] 'password']
[, user [IDENTIFIED BY [PASSWORD] 'password']] ...
[REQUIRE
NONE |
[{SSL| X509}]
[CIPHER 'cipher' [AND]]
[ISSUER 'issuer' [AND]]
[SUBJECT 'subject']]
[WITH with_option [with_option] ...]
object_type =
TABLE
| FUNCTION
| PROCEDURE
with_option =
GRANT OPTION
| MAX_QUERIES_PER_HOUR count
| MAX_UPDATES_PER_HOUR count
| MAX_CONNECTIONS_PER_HOUR count
| MAX_USER_CONNECTIONS count
不知道你的STUDENT、SC 是什么,ON后面的应该是表名。
展开全部
授权之前应该先建立用户,你执行下面的语句就明白了:
SELECT
*
FROM
mysql.user;
补充:
下面是GRANT的语句说明:
GRANT priv_type [(column_list)] [, priv_type [(column_list)]] ...
ON [object_type] {tbl_name | * | *.* | db_name.*}
TO user [IDENTIFIED BY [PASSWORD] 'password']
[, user [IDENTIFIED BY [PASSWORD] 'password']] ...
[REQUIRE
NONE |
[{SSL| X509}]
[CIPHER 'cipher' [AND]]
[ISSUER 'issuer' [AND]]
[SUBJECT 'subject']]
[WITH with_option [with_option] ...]
object_type =
TABLE
| FUNCTION
| PROCEDURE
with_option =
GRANT OPTION
| MAX_QUERIES_PER_HOUR count
| MAX_UPDATES_PER_HOUR count
| MAX_CONNECTIONS_PER_HOUR count
| MAX_USER_CONNECTIONS count
不知道你的STUDENT、SC
是什么,ON后面的应该是表名。
SELECT
*
FROM
mysql.user;
补充:
下面是GRANT的语句说明:
GRANT priv_type [(column_list)] [, priv_type [(column_list)]] ...
ON [object_type] {tbl_name | * | *.* | db_name.*}
TO user [IDENTIFIED BY [PASSWORD] 'password']
[, user [IDENTIFIED BY [PASSWORD] 'password']] ...
[REQUIRE
NONE |
[{SSL| X509}]
[CIPHER 'cipher' [AND]]
[ISSUER 'issuer' [AND]]
[SUBJECT 'subject']]
[WITH with_option [with_option] ...]
object_type =
TABLE
| FUNCTION
| PROCEDURE
with_option =
GRANT OPTION
| MAX_QUERIES_PER_HOUR count
| MAX_UPDATES_PER_HOUR count
| MAX_CONNECTIONS_PER_HOUR count
| MAX_USER_CONNECTIONS count
不知道你的STUDENT、SC
是什么,ON后面的应该是表名。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
有这个问题啊,很多mysql安装过程中都有点问题;
请楼主多试几次,每次清除相关的注册表和文件.
请楼主多试几次,每次清除相关的注册表和文件.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询