I follow official guide  use mysql database engine to  exchange data between ClickHouse and MySQL
`insert into mysql_database.testUser
 select * from clickHouse_database.testUser`

But it throw a exception : Poco::Exception. Code: 1000, e.code() = 1366, e.displayText() = mysqlxx::BadQuery: Incorrect string value: '\xF0\x9F\xA6\x84\xE2\x98...' for column 'person_name' at row 1 (*****:3306) (version 20.8.4.11)

The column value in clickhouse is：小野马-🦄☁️ ,while remote  mysql CHARSET is utf8mb4; It seems that the exception  because of the emoji value. How can I fix this problem?


#if __has_include(<mysql.h>)
#include <mysql.h>
#else
#include <mysql/mysql.h>
#endif
#include <mysqlxx/Connection.h>
#include <mysqlxx/Exception.h>
static inline const char* ifNotEmpty(const char* s)
{
    return s && *s ? s : nullptr;
}
namespace mysqlxx
{
LibrarySingleton::LibrarySingleton()
{
    if (mysql_library_init(0, nullptr, nullptr))
        throw Exception("Cannot initialize MySQL library.");
}
LibrarySingleton::~LibrarySingleton()
{
    mysql_library_end();
}
auto & LibrarySingleton::instance()
{
    static LibrarySingleton instance;
    return instance;
}
Connection::Connection()
    : driver(std::make_unique<MYSQL>())
{
    
    LibrarySingleton::instance();
}
Connection::Connection(
    const char* db,
    const char* server,
    const char* user,
    const char* password,
    unsigned port,
    const char * socket,
    const char* ssl_ca,
    const char* ssl_cert,
    const char* ssl_key,
    unsigned timeout,
    unsigned rw_timeout,
    bool enable_local_infile)
    : Connection()
{
    connect(db, server, user, password, port, socket, ssl_ca, ssl_cert, ssl_key, timeout, rw_timeout, enable_local_infile);
}
Connection::Connection(const std::string & config_name)
    : Connection()
{
    connect(config_name);
}
Connection::~Connection()
{
    disconnect();
    mysql_thread_end();
}
void Connection::connect(const char* db,
    const char * server,
    const char * user,
    const char * password,
    unsigned port,
    const char * socket,
    const char * ssl_ca,
    const char * ssl_cert,
    const char * ssl_key,
    unsigned timeout,
    unsigned rw_timeout,
    bool enable_local_infile)
{
    if (is_connected)
        disconnect();
    if (!mysql_init(driver.get()))
        throw ConnectionFailed(errorMessage(driver.get()), mysql_errno(driver.get()));
    is_initialized = true;
    
    if (mysql_options(driver.get(), MYSQL_OPT_CONNECT_TIMEOUT, &timeout))
        throw ConnectionFailed(errorMessage(driver.get()), mysql_errno(driver.get()));
    