Unable to get access to Mariadb inside of docker with AWS Lightsail

0

So I have access inside my virtual machine to run mysql with the following commands: mysql -h (IP for mariadb) -u (user) -p (password) databasename Now, when I try creating the following commands to run mariadb inside of a docker container: [ref] (how to remote access to mariadb on docker?). Then, when I do show tables it says Empty set (0.000 sec). I don't know why I am not able to see the data through docker. I tried using docker ip for the container as well and same thing as well. Does anyone know a way around this? Thank you in advance.

profile picture
preguntada hace un año340 visualizaciones
1 Respuesta
0

Some follow-up questions:

  1. Are you trying to connect to an existing mariaDB instance from a docker is your db running on another docker?
  2. When you run the mysql -h (IP for mariadb) -u (user) -p (password) databasename, is the connection successful or are there any error logs?
AWS
respondido hace un año
    1. The MariaDB is completely separated from AWS. I am just trying to access it through the AWS Lightsail instance.
    2. I was able to access it inside docker when I specified --tcp protocol. I am not sure how to achieve the same using docker-compose file. What is the format of it? Thanks

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas