I can’t connect my directus project with mysql server.
Getting connection refused error
.
However when I’m running this command, I’m able to connect: mysql -u root -p -h localhost -P 3306
My docker-compose.yml file:
version: '3'
services:
directus:
container_name: directus
image: directus/directus:latest
ports:
- 8055:8055
environment:
KEY: '255d861b-5ea1-5996-9aa3-922530ec40b1'
SECRET: '6116487b-cda1-52c2-b5b5-c8022c45e263'
DB_CLIENT: 'mysql'
DB_HOST: 'localhost'
DB_PORT: '3306'
DB_DATABASE: 'directus'
DB_USER: 'root'
DB_PASSWORD: 'Hitman959.....'
MYSQL_ROOT_PASSWORD: 'Hitman959.....'
MYSQL_USER: 'root'
MYSQL_PASSWORD: 'Hitman959.....'
MYSQL_DATABASE: 'directus'
ADMIN_EMAIL: '[email protected]'
ADMIN_PASSWORD: 'admin'
networks:
directus:
2
Answers
I actually faced the same issue and after terrible search finally I made the solution.
You can connect to mysql by using this modified code:
change password ) key and secret)