Just use host.docker.internal
instead of localhost
.
To make it work on Linux, you just need to start your Docker container passing the parameter --add-host host.docker.internal:host-gateway
More Related Contents:
- Docker-compose check if mysql connection is ready
- MYSQL_ROOT_PASSWORD is set but getting “Access denied for user ‘root’@’localhost’ (using password: YES)” in docker container
- Communications link failure , Spring Boot + MySql +Docker + Hibernate
- Connect to Docker MySQL container from localhost?
- Node.js connect to MySQL Docker container ECONNREFUSED
- connecting to a docker-compose mysql container denies access but docker running same image does not
- django cannot connect mysql in docker-compose
- Setting up MySQL and importing dump within Dockerfile
- How can I initialize a MySQL database with schema in a Docker container?
- Connect to mysql in a docker container from the host
- How to connect mysql workbench to running mysql inside docker?
- How do I know when my docker mysql container is up and mysql is ready for taking queries?
- Docker (Apple Silicon/M1 Preview) MySQL “no matching manifest for linux/arm64/v8 in the manifest list entries”
- Commit data in a mysql container
- Access to mysql container from other container
- How to initialize mysql container when created on Kubernetes?
- MySQL scripts in docker-entrypoint-initdb are not executed
- MySQL string replace
- How do I find the MySQL my.cnf location
- What’s faster, SELECT DISTINCT or GROUP BY in MySQL?
- MySQL select one column DISTINCT, with corresponding other columns
- How to use mysql JOIN without ON condition?
- ERROR: Error 1005: Can’t create table (errno: 121)
- Mysql Convert Column to row (Pivot table )
- I keep getting this mysql error code #1089
- How to close sqlalchemy connection in MySQL
- How can I achieve initcap functionality in MySQL?
- Update multiple rows with multiple ‘where’ clauses for each individual row
- WHERE datetime older than some time (eg. 15 minutes)
- Is there a way to use ON DUPLICATE KEY to Update all that I wanted to insert?