# MySQL Connector cannot connect to Elasticsearch Docker Instance

**URL:** <https://discuss.elastic.co/t/mysql-connector-cannot-connect-to-elasticsearch-docker-instance/346043>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [October 30, 2023, 2:18pm UTC](https://discuss.elastic.co/t/mysql-connector-cannot-connect-to-elasticsearch-docker-instance/346043 "2023-10-30T14:18:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 30, 2023, 3:38pm UTC](https://discuss.elastic.co/t/mysql-connector-cannot-connect-to-elasticsearch-docker-instance/346043/2 "2023-10-30T15:38:23Z")

</div>

Are these 2 separate containers? if so `localhost` to connect to each other... will not work as 1 container's `localhost` is separate from the other container's `localhost`

Perhaps take a look at

> [@Filebeat Docker - Elasticsearch Host Issue](https://discuss.elastic.co/t/filebeat-docker-elasticsearch-host-issue/320083/2):
>
> Hi @mwsprotte Welcome to the community! Docker Networking Issue not Elastic... Another explanation Might be worth reading... if you are new to docker try using host.docker.internal docker run \ --net=elastic docker.elastic.co/beats/filebeat:7.17.4 \ setup -E setup.kibana.host=host.docker.internal:5601 \ -E output.elasticsearch.hosts=["https://host.docker.internal:9200"]

in short, you will probably need to use `host.docker.internal` between the two containers

---

_[View the full topic](https://discuss.elastic.co/t/mysql-connector-cannot-connect-to-elasticsearch-docker-instance/346043)._
