免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1448 | 回复: 4
打印 上一主题 下一主题

奇怪的Mysql的用户权限问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-01-05 12:23 |只看该作者 |倒序浏览
我用grant all on domain_abc.* to test@localhost identified by "test";语句只给用户test对于数据库domain_abc的权限,但是该用户却能创建类似domain?abc这样数据库名称的数据库,其他名称的数据库该用户没有权限创建,正常的应该没有创建任何数据库的权限,
请大侠们帮忙看看是怎么回事呢?


mysql>; create database  domain_abc;
Query OK, 1 row affected (0.00 sec)

mysql>; grant all on domain_abc.* to test@localhost identified by "test";
Query OK, 0 rows affected (0.01 sec)

mysql>; exit
Bye
bash-2.05b# mysql -utest -ptest
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 53980 to server version: 4.0.14-log

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

mysql>; show databases;
+------------+
| Database   |
+------------+
| domain_abc |
+------------+
1 row in set (0.02 sec)
mysql>; create database test_abc;                       
ERROR 1044: Access denied for user: 'test@localhost' to database 'test_abc'
mysql>;
mysql>; create database domain1abc;
Query OK, 1 row affected (0.00 sec)

mysql>; show databases
    ->; ;
+------------+
| Database   |
+------------+
| domain1abc |
| domain_abc |
+------------+
2 rows in set (0.02 sec)

论坛徽章:
0
2 [报告]
发表于 2005-01-05 14:52 |只看该作者

奇怪的Mysql的用户权限问题

同测………………

论坛徽章:
0
3 [报告]
发表于 2005-01-05 14:55 |只看该作者

奇怪的Mysql的用户权限问题

all 与 all privalages 是不同的。。。
详情可见mysql的文档。

论坛徽章:
0
4 [报告]
发表于 2005-01-05 15:00 |只看该作者

奇怪的Mysql的用户权限问题

mysql>; grant all privileges  on abc_dd.* to bbb@localhost identified by "bbb";
Query OK, 0 rows affected (0.01 sec)

mysql>; \q
Bye

[root@localhost root]# /data2/mysql/bin/mysql -ubbb -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 4.0.20-log

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

mysql>; show databases;
+----------+
| Database |
+----------+
| abc1dd   |
| abc_dd   |
| abcddd   |
| abcedd   |
| test     |
+----------+
5 rows in set (0.00 sec)

mysql>; create database abc22dd;
ERROR 1044: Access denied for user: 'bbb@localhost' to database 'abc22dd'
mysql>; use abc1dd;            
Database changed
mysql>; use abc_dd;
Database changed
mysql>; use abcddd;
Database changed
mysql>; use use abcedd
ERROR 1044: Access denied for user: 'bbb@localhost' to database 'use'
mysql>; use abcedd;
Database changed
mysql>; create database abc2dd;
Query OK, 1 row affected (0.00 sec)

mysql>; create database abc3dd;
Query OK, 1 row affected (0.00 sec)

mysql>; create database abcrdd;
Query OK, 1 row affected (0.00 sec)


这个现象依然存在。。。

论坛徽章:
0
5 [报告]
发表于 2005-01-05 15:17 |只看该作者

奇怪的Mysql的用户权限问题

是啊,到底怎么回事啊?是mysql的bug么?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP