How to connect one docker project to another docker project database

So I have two docker projects in local development one running a MySQL database and the other not running any MySQL. How do you connect the docker project without a database to the one that has the database?

I used direct connection and added all the credentials from the project running the database. I test the connection it said ok. But once I created an insert form in the none database project and actually tried to submit the form with some data I got a 500 response which is leading me think maybe that’s not quite possible on local development. Can someone explain to me what I am missing or how to accomplish this task. Thanks.

@Teodor @George @ben

To answer my question. So, from testing its best to just deploy the docker container to a remote server then use the remote database setting/credentials on your local development. Here is what a successful connect would look like, (see image attached). Now this will allow you to run two containers, one with your database and node.js frontend application and the other container with the backend application like a CMS for example connected to the same database to manage the frontend content. Now, why the hell would you wanna do something like this! Idk! But when you reach this cross road this direction will be here.