0

I am trying to connect to magento database of another system with the following configuration in app/etc/env.php

  array (
    'host' => '192.168.1.172',
    'dbname' => 'datacenter',
    'username' => 'root',
    'password' => 'root',
    'active' => '1',
  ),

But i keep getting the below error, is there anything i can do to fix it? Your inputs are much appreciated.

2 exception(s): Exception #0 (Zend_Db_Adapter_Exception): SQLSTATE[HY000] [2002] Connection refused Exception #1 (PDOException): SQLSTATE[HY000] [2002] Connection refused

0

You should have to allow mysql connection from remote user.

here your remote machine is your magento instances

Edit my.cnf/my.ini file changing bind-address parameter to:

bind-address = 0.0.0.0

Also, make that skip-networking parameter is not defined.

For Linux:

/etc/mysql/my.cnf Debian/Ubuntu

/etc/my.cnf CentOS/CloudLinux/RHEL

For Windows:

"%plesk_dir%\MySQL\my.ini" for Plesk databases(port 8306)

"%plesk_dir%\Databases\MySQL\my.ini" for Clients databases(port 3306)

After that, restart MySQL server.

Look more for detail

Magento Doc OR Plesk

hope this will work for you.

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.