cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 Single Database used by mutliple instances

SOLVED

Magento 2 Single Database used by mutliple instances

Hi,

 

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.
 
Please help
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2 Single Database used by mutliple instances

Hello @mohamed_rafiq 

 

Please refer the below URL:

https://www.hostgator.com/help/article/how-to-whitelist-your-ip-in-cpanel-for-remote-mysql-access

 

You need to add 2 instance IP in remote MySQL.
 
I hope it helps.
 
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

View solution in original post

1 REPLY 1

Re: Magento 2 Single Database used by mutliple instances

Hello @mohamed_rafiq 

 

Please refer the below URL:

https://www.hostgator.com/help/article/how-to-whitelist-your-ip-in-cpanel-for-remote-mysql-access

 

You need to add 2 instance IP in remote MySQL.
 
I hope it helps.
 
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.