[Hive]-database

Source: Internet
Author: User

1.Create Database

  CREATE (DATABASE|SCHEMA) [IF NOT EXISTS] database_name

[COMMENT database_comment]-- Database Description

[Location Hdfs_path]-- database SourceData storage Path

[With Dbproperties (Property_name=property_value,...)] -- Other database Settings

2.Drop Database

DROP (database| SCHEMA) [IF EXISTS] database_name [restrict| CASCADE];

RESTRICT Default Usage

CASCADE Deleting a database with tables

3.Alter Database

  ALTER (DATABASE|SCHEMA) database_name SET DBPROPERTIES (property_name=property_value, ...)

  ALTER (DATABASE|SCHEMA) database_name SET OWNER [USER|ROLE] user_or_role; 

   ALTER (DATABASE|SCHEMA) database_name SET LOCATION hdfs_path;  4. Character Set encodingUsing MySQL as Hive's metadatabase, when the field is garbled in Chinese, can not forcibly change the entire encoding set of MySQL to UTF8, must be latin1 and can only be changed to the Chinese field of the character set encoding to UTF8 modify the field annotation character set alter   Table COLUMNS Modify column COMMENT varchar (character set UTF8;   Modify table comment Character set ALTER TABLE tabl_params Modify column Param_value varchar (4000) character set UTF8; There is also a JDBC connection to hive that modifies the character set to UTF8 Jdbc:mysql://192.168.0.128:3306/hive?characterencoding=utf-8

[Hive]-database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.