hive数据库操作——hive命令行,
hive数据库操作——hive命令行
本文主要介绍通过hive命令行对hive数据库进行操作。好,下面上货。 1、显示所有数据库 show databases;
模糊匹配数据库名称 show databases like 'd*'; 、
2、数据库新增 create database if not exists xytestdatabase; 、
新增数据库后,能够在hdfs中查询到数据库的位置
3、查看数据库的具体信息 describe database xytestdatabase;
或者使用更详细的方式。 describe database extended xytestdatabase;
4、删除数据库 drop database if exists xytestdatabase;
删除数据库的时候有一点需要注意,如果数据库中是有表的,那么是不允许删除的,如果想要删除,那么想要使用如下命令: drop database if exists xytestdatabase cascade;
注意:在hive中是不能对数据库进行修改的,无论是数据的名称,还是数据库的存储路径都是不能修改的。
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。