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
posta un anno fa340 visualizzazioni
1 Risposta
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
con risposta un anno fa
    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

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande