I have setup docker container with mysql that expose 3306. I\'ve specified database user, database password and create a test db and give the privileges to new user. In
In your docker-compose.yml file add a link property to your webserver service: https://docs.docker.com/compose/networking/#links
Then in your query string, the host parameter's value is your database service name:
$mysqli = new mysqli("database", "mattia", "prova", "prova");