SQOOP Export: mysql> create a Hive table (????)
Like this:
I have modified it once before, and the method works together. However, when the server is changed and the MySQL library is newly created, method one fails to work, and method two takes effect.
Method one:
Create a new query window, or use the command to enter mysql> , the input
Like this:
I have modified it once before, and the method works together. However, when the server is changed and the MySQL library is newly created, method one fails to work, and method two takes effect.
Method one:
Create a new query window, or use the command to enter mysql> , the input
set character_set_database=utf8;
set character_set_server=utf8;
Show variables like ‘character%’; View the results:
SQOOP script with:?useUnicode=true& characterEncoding=utf-8
Import the data again without scrambling.
Method 2:
Modify the system file: /etc/my.cnf
vim /etc/my.cnf
Text:
init_connect=’SET collation_connection = utf8_unicode_ci’ init_connect=’SET NAMES utf8′ character-set-server=utf8 collation-server=utf8_unicode_ci skip-character-set-client-handshake |
Directing to /bin/systemctl Restart mysqld. Service (1) : Directing to /bin/systemctl Restart mysqld.
Sqoop plus?useUnicode=true& CharacterEncoding = UTF-8, Chinese garbled code problem resolved.
In the first method, the set modifies the configuration and restarts MySQL. This is probably the first reason why the configuration change does not work.
Read More:
- Using sqoop to export data from hive to MySQL
- Error reporting when importing sqoop from Mysql to hive
- “Hive metadata problem” hive.metastore.HiveMetaException : Failed to get schema version.
- Export and import method of MySQL under Linux
- Import / export. SQL file / gzip file for MySQL under Linux
- When executing hive – f script com.mysql.jdbc . exceptions.jdbc4 .CommunicationsException: Communications link failure
- After installing MySQL again under Linux, the solution of ‘MySQL module failed to start’ appears
- It can’t connect to local MySQL server through socket ‘/ tmp/ mysql.sock ‘(2) “;
- MySQL: if the remote connection using navicatip fails, prompt “is not allowed to connect to this MySQL server”
- The MySQL service suddenly hangs up with the error message can’t connect to MySQL server on ‘localhost’ (10061)
- MySQL error set: failed to start mysql.service : Unit mysql.service is masked.
- When MySQL is running, the server suddenly goes down, which causes Mysql to be unable to restart
- hive is not allowed to impersonate anonymous
- Hive: How to Solve dearby database initialization error
- PHP connection to MySQL database error: call to undefined function MySQL_ connect()
- MySQL Workbench: Error Code: 2013. Lost connection to MySQL server during query solution
- MySQL error — multiple methods of failed to find valid data directory and MySQL setting password appear
- MySQL Workbench Failed to Connect to MySQL at 127.0.0.1:3306 with user root Bad handshake
- Analysis of JDBC connection to MySQL
- spark SQL Export Data to Kafka error [How to Solve]