Question

All old project get connected to the last mysql database created

Hello, After a long search in many platform for someone who have same issue but i didn’t find any solution… i have deployed 2 express api in same droplet using nginx blocks following this tutorial who is really great and thanks to their authors. https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04

https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

Now when i end deploying first project everything work fine but when i do same for the other project my second project work fine also but my first project get connected automatically to the second database created.

my .env file on the first project look like this.

HOST=localhost PORT_DB=3306 USER=root PASSWORD_DB=000000 DIALECT=mysql NAME_DB=database1

my .env file on the second project look like this.

HOST=localhost PORT_DB=3306 USER=root PASSWORD_DB=000000 DIALECT=mysql NAME_DB=database2

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!