0

Here is my function for external database connection and using connection factory class to create connection, it is working fine in 2.3.3. //use Magento\Framework\App\ResourceConnection\ConnectionFactory;

public function getConnection(){    
 $db = $this->connectionFactory->create(
            [
                'host' => XX.XXX.XXX.X,
                'dbname' => 'dbname',
                'username' => 'username',
                'password' => 'password',
                'active' => '1',
            ]
        );
    return $db;
}

However when i tested it in 2.3.4 i am getting this error

Exception #0 (Zend_Db_Adapter_Exception): SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'
Exception #1 (PDOException): SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'

Note: host is external IP of the database that i am using to connect.

  • Host name was not coming correctly,once I fixed the host name it started work – Muhammad Ayaz Apr 3 at 9:51
0

it looks like to me that you tried to access the database as root which is not allowed. Are you running the db inside of a docker container?

| improve this answer | |
0

Host name was not coming correctly,once I fixed the host name it started work

| improve this answer | |

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.