|
刚刚接触mysql,在看了书之后,对于权限有一个问题。
在新建了一个用户后,没有赋予任何权限,但是这个用户为什么就能查询其它数据库的表数据呢?
还是我理解有问题呢?
--创建新用户
[root@gc ~]# mysql -uroot -proot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 47
Server version: 5.5.24 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create user lcz@localhost identified by 'lcz';
Query OK, 0 rows affected (0.02 sec)
mysql> show grants for lcz@localhost;
+------------------------------------------------------------------------------------------------------------+
| Grants for lcz@localhost |
+------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'lcz'@'localhost' IDENTIFIED BY PASSWORD '*A1238F347489C1C8313C8BC039B6C6B1E00A6640' |
+------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> exit
Bye
--用新用户登录
[root@gc ~]# mysql -ulcz -plcz
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 48
Server version: 5.5.24 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
--此时就能查到其它数据库表数据
mysql> select count(1) from sqoop.tb1;
+----------+
| count(1) |
+----------+
| 93 |
+----------+
1 row in set (0.00 sec)
mysql> create table test.t1 as select * from sqoop.tb1;
Query OK, 93 rows affected (0.16 sec)
Records: 93 Duplicates: 0 Warnings: 0
|
|