0

Good morning, I generate the database with this initial script, but the word CRÉDITOS incorrectly saved with the value CRÉDITOS.

Script sql/script.sql

CREATE TABLE my_table
(
    COD_PRODUCTO VARCHAR(5),
    NOM_PRODUCTO VARCHAR(100),
    CONSTRAINT PRIMARY KEY (COD_PRODUCTO )
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO DB_CLIENTES_POTENCIALES.my_table
VALUES ('yy', 'CRÉDIOS');

Docker build

docker build -f GenerarMariaDb.Dockerfile -t clientespotencialesmariadb_image:latest .

Docker run

docker run --env-file=clientes-potenciales-mariadb.env -d -p 3306:3306 --name clientespotencialesmariadb clientespotencialesmariadb_image:latest --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci

Docker file

FROM mariadb:latest

ADD sql/ /docker-entrypoint-initdb.d/

#RUN apt-get update && apt-get -y install vim

EXPOSE 3306

CMD ["mysqld"]

Docker env

MYSQL_ROOT_PASSWORD=XXXX
MYSQL_DATABASE=DB_CLIENTES
MYSQL_USER=XXXX
MYSQL_PASSWORD=XXXX

Record saved with wrong encoding

enter image description here

Could someone point out to me that I'm forgetting?

Thanks you!

Kamousagi
  • 573
  • 1
  • 4
  • 8
  • See 'Mojibake' in https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James Oct 03 '20 at 00:55
  • Does this answer your question? [Trouble with UTF-8 characters; what I see is not what I stored](https://stackoverflow.com/questions/38363566/trouble-with-utf-8-characters-what-i-see-is-not-what-i-stored) – Rick James Oct 03 '20 at 00:56

0 Answers0