Sqoop is exported from hive to MySQL using export. There is a garbled code problem

leileihhxx 2022-02-13 07:44:12 阅读数:353

sqoop exported hive mysql using

As shown in the figure

 

Solution :

Mysql When building the database , Set the encoding mode to utf8.

create database if not exists test DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

 

character set It's a character set.

collate Set collation .

Just in case , Also set up a table utf8

CREATE TABLE IF NOT EXISTS t_order_subscribe_total(
    DATE DATE COMMENT ' date ',
    subscribe_name VARCHAR(20) COMMENT ' Whether to make an appointment ',
    COUNT INT COMMENT ' Order quantity '
)charset utf8 collate utf8_general_ci;

Solve the problem of disorderly code

  Pay attention to character set coding in Chinese !

copyright:author[leileihhxx],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130744106274.html