Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

441
Vistas
How to set mysql global variables running on Docker instance started by TestContainers

I am currently running a Java Spring application using TestContainers to manage my datasources. I am having issues setting global variables for my MySQL instance on Docker during initialization of the docker instance.

I've tried a few things.

TestContainers has a method execInContainer which takes a string of commands.

container.execInContainer("mysqld", "--character_set_server=utf8");

In addition, you can also run an init script using .withInitScript("mysql_test_init.sql");

SET @@global.character_set_client = 'utf8';
SET @@global.character_set_server = 'utf8';

Using execInContainer seems to do nothing and does not change the variable(s) in MySQL.

Using the script fails due to Docker using a non-root user to make changes.

Access denied for user 'test'@'%' (using password: YES)

Is there a way I can easily change/configure the global variables of MySQL. Am I doing something wrong?

Some parameters I would like to change:

  • character_set_client
  • character_set_connection

Thank you.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda