Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Chinese word become unrecognizable code using "addSchema(SCHEMA,scriptSources)" method #115

@flian

Description

@flian

Using bellow cofig to start embedded-mysql:

MysqldConfig config = aMysqldConfig(v5_6_35)
                .withCharset(UTF8)
                .withPort(getPort())
                .withUser(USERNAME, PASSWORD)
                .withTimeout(2, TimeUnit.MINUTES)
                .withServerVariable("max_connect_errors", 666)
                .build();

EmbeddedMysql mysqld = anEmbeddedMysql(config, downloadConfig)
                .addSchema(SCHEMA,"db/001_init.sql")
                .start();

where db/001_init.sql:

create table t1 (col1 INTEGER NOT NULL,col2 VARCHAR(10));

INSERT INTO t1 values(10, "你好!");

after mysql start, "你好!" become unrecognizable code in table.

after research, probability fix:

add paramter to MysqlClient.java about line 54, after "--password=" with

"--default-character-set=utf8".

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions