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
已提問 1 年前檢視次數 339 次
1 個回答
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
已回答 1 年前
    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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南