hive metadata 存mysql 注释中文乱码的问题
###########?hive 中文乱码的问题#############
###########?hive 中文乱码的问题#############
解决方案:数据库编码为latin1.将一下表的字段(涉及注释的字段都改)编码设定为UTF8
1、然后进入数据库执行以下5条SQL语句:
(1)修改表字段注解和表注解
alter table COLUMNS_V2 modify column COMMENT varchar(256) character set utf8
alter table TABLE_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8
(2) 修改分区字段注解:
?alter table PARTITION_PARAMS ?modify column PARAM_VALUE varchar(4000) character set utf8 ;?
alter table PARTITION_KEYS ?modify column PKEY_COMMENT varchar(4000) character set utf8;?
(3)修改索引注解:
alter table ?INDEX_PARAMS ?modify column PARAM_VALUE ?varchar(4000) character set utf8;
?
2、修改hive连接mysql的连接为utf-8<property>?
?? <name></name>?
? <value>jdbc:mysql://IP:3306/hive?createDatabaseIfNotExist=true&characterEncoding=UTF-8</value>?
? <description>JDBC connect string for a JDBC metastore</description>?
</property>