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
gefragt vor einem Jahr339 Aufrufe
1 Antwort
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
beantwortet vor einem Jahr
    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

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen