0

On my site with Magento installed, I can't call up the database that is present on another domain. I wish I could have one database for multiple sites with Magento.

How can I retrieve the database with my site with Magento which is present on another domain?

Thanks so much for any help.

5
  • what error you have? – MagenX Jul 29 '16 at 8:04
  • a:5:{i:0;s:94:"SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known";i:1;s:1836:"#0 /var/www/vhosts/mysite.it/httpdocs/new/shop/lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect() – Gabriel91 Jul 29 '16 at 8:09
  • are you sure you have correct hostname/ip ? – MagenX Jul 29 '16 at 8:26
  • Yes man, I also checked now, but without success. – Gabriel91 Jul 29 '16 at 8:34
  • check you have permission to access mysql outside of your host – Minesh Patel Jul 29 '16 at 9:26
0

Make sure you have correct config for databse host in app\etc\local.xml file

<host><![CDATA[your-host-ip]]></host>

OR

<host><![CDATA[your-host-full-url]]></host>

and check you have permission to access mysql outside of your host

If it still not solve your problem check DNS Issue

0

You need to setup your magento with multistore.

You can point your each store with multiple domain with one database.

Read this guide : http://docs.magento.com/m1/ce/user_guide/store-operations/store-hierarchy.html

open up the index.php file and look for this line (it's the last line of the file):

Mage::run($mageRunCode, $mageRunType);

Add the following code right before the above code:

$mageRunCode = 'YOUR_WEBSITE_CODE';

$mageRunType = 'website';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.