mysql>flush privileges;_mysql flush privileges 仅对新连接生效

- 日理万妓 2023-01-12 11:55 192阅读 0赞

mysql> update user set Create_user_priv=’N’ where host like ‘172.18.%’;

Query OK, 5 rows affected (0.00 sec)

Rows matched: 5 Changed: 5 Warnings: 0

之前已经把所有权限置为N

mysql> flush privileges;

Query OK, 0 rows affected (0.02 sec)

mysql> update user set Create_user_priv=’N’ where host like ‘172.18.%’;

Query OK, 0 rows affected (0.00 sec)

Rows matched: 5 Changed: 0 Warnings: 0

mysql> update user set Create_user_priv=’N’ where host like ‘172.18.%’;

Query OK, 0 rows affected (0.00 sec)

Rows matched: 5 Changed: 0 Warnings: 0

mysql> update user set Create_user_priv=’Y’ where host like ‘172.18.%’;

Query OK, 5 rows affected (0.01 sec)

Rows matched: 5 Changed: 5 Warnings: 0

mysql> update user set Create_user_priv=’N’ where host like ‘172.18.%’;

Query OK, 5 rows affected (0.02 sec)

Rows matched: 5 Changed: 5 Warnings: 0

显然还可以UPDATE

mysql> exit

Bye

C:\Documents and Settings\yueyang>mysql -uroot -pmysqlIIT -htc-pelive1.tc

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 323172 to server version: 5.0.16-max-log

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> update user set Create_user_priv=’N’ where host like ‘172.18.%’;

ERROR 1046 (3D000): No database selected

mysql> use mysql;

Database changed

mysql> update user set Create_user_priv=’N’ where host like ‘172.18.%’;

ERROR 1142 (42000): UPDATE command denied to user ‘root’@’172.18.112.50’ for tab

le ‘user’

只有重新连接,权限检查才生效

最后修改于 2008-06-12 19:45

阅读(?)评论(0)

发表评论

表情:
评论列表 (有 0 条评论,192人围观)

还没有评论,来说两句吧...

相关阅读

    相关 out.flush()

    [out.flush()][out.flush] 关于java中输出流flush()方法 在java开发中,有时我们会进行流的操作,所以可能会经常遇到这样一段代码 out