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

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ