Magento 2 Single Database used by mutliple instances
I am setting up an environment where Nginx will act as a reverse proxy to 2 Magento servers on different machines. The 2 Magento servers will be sharing a single database on a remote machine.
The issue I am facing is when I do the setup for 1 instance it works fine but when I try to the setup for the 2 instances I am not able to connect to the database although the ports are open and I tried telnet and it's successful.
Even though I am using the remote IP of MySQL server on instance 2 it shows as below:
Access denied for user 'magento'@'magentoInstance2' (using password: YES), instead of showing the remote hostname it is showing the localhost name.
I tried copying the whole code from instance 1 into instance 2 but still the same issue.