This is my simple PDO instance example:
try {
$dbh = new PDO('mysql:host=my-db-server-instance;port=3306;dbname=MY_DB_NAME','admin','mypass');
foreach($dbh->query('SELECT * from user limit 10') as $row) {
print_r($row);
}
$dbh = null;
die();
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
This works as intended. The problem is when I try to use redbean with this PDO instance (Using setup method to pass params doesn’t work either):
$dbh = new PDO('mysql:host=my-db-server-instance;port=3306;dbname=MY_DB_NAME','admin','mypass');
R::setup($dbh);
This shows this auth error: code 500 — VERBOSE: Internal error: /srv/app/djf9839484/htdocs/service/vendor/gabordemooij/redbean/RedBeanPHP/Driver/RPDO.php line 206 : SQLSTATE[28000]: Invalid authorization specification: 1045 Access denied for user ‘admin’@’%’ (using password: YES)”
Have been checking sources and everything seems ok. Has anybody found a solution to this problem?