1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Linuxのdocker上のredashからlocalhostのMySQLに接続

Posted at

CentOS7にdockerでredashを構築して、localhostのMySQLに接続しようとしたところ、接続先名はlocalhostではつながらなかった。

docker上のredashとローカルのmysqlを連携させる
上記の記事によるとMacやWindowsだとhost.docker.internalで接続できる。

How to connect locally hosted MySQL database with the docker container
上記の記事によると、Linuxだと172.18.0.1で繋がる。

また、MySQL側もlocalhost以外で繋げるように、ユーザーの権限を172.18.0.1または'%'で指定する必要がある。

grant all privileges on sample.* to testuser@'%';

MySQL サーバーに外部(localhost以外)から接続する方法

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?