mysql -h master -uroot
or
mysql
-uroot
-p
select host,user
from mysql.user;
查看MYSQL数据库中所有用户
mysql> SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';')
AS query FROM mysql.user;
查看数据库中具体某个用户的权限
mysql> show grants for 'hive'@'%';
+-----------------------------------------------------------------------------------------------------+
| Grants for hive@% |
+-----------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'hive'@'%' IDENTIFIED BY PASSWORD '*4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC' |
+-----------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
查询有哪些数据库
SHOW DATABASES;
hive 登录
mysql -uhive -h master -p