-
Notifications
You must be signed in to change notification settings - Fork 69
Description
Hi,
I had to reinstall my MariaDB database, and after that my RectPHP programs didn't work anymore. The only message that returned was "Unable to connect to database server".
To discover the error, I installed the 01-query.php and run it a lot of times filling the \vendor\react\mysql\src\Io\LazyConnection.php and \vendor\react\mysql\src\Factory.php with echos. Then I discovered in \vendor\react\mysql\src\Factory.php that at connection error detection, the variable $error has the real error “Connection Refused”, but it is returned to caller as "Unable to connect to database server", although the variable $error is passed also on return, but not shown after.
With this information I discovered that the connection to port 3306 was closed. After that the solution was fast: Rereading some documentation I've written in the past, I saw that I have to make a change in /opt/lampp/etc/my.cnf. 'skip-networking' is uncommented as default, but must be commented.
After that all is working again.
My suggestion is to show the real error message returned by MySQL in \vendor\react\mysql\src\Factory.php.
...
}, function ($error) use ($deferred) {
echo($error);
...
});
Best