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

198
Vistas
Query MySql database in Docker

I have a docker container with mariadb, and have created a database my_db in it (through an external script in a different container). How can I run SQL queries on my_db now from the command line? I just want to do

select * from my_table

from the terminal that is running the container.

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Easiest way is to exec into the container and execute the query using the mysql client, given the clients installed.

docker exec -it CONTAINER_NAME mysql -p -e 'QUERY' DB_NAME
about 4 years ago · Santiago Trujillo Denunciar

0

If you have the commandline tool installed in the app container,

mysql -h 192.168.1.7 -u admin -pxyz -P 10202

This allows for the docker instance to be on another machine (192...) and with a special port (-P ...), etc. (I have multiple docker containers; that one is for MariaDB 10.2.2.)

about 4 years ago · Santiago Trujillo Denunciar
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