You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
carliedu
changed the title
Real MySQL error no shown
Real MySQL error not shown
Nov 19, 2021
@carliedu Thanks for bringing this up, I completely agree that the current error reporting wasn't particularly helpful in your situation.
The good news is that this has already been addressed via #141. You can try this by installing the current dev-master version.
I'll make sure to get this released asap, expect some updates in the next couple of weeks!
I believe this has been answered, so I'm closing this for now. Please come back with more details if this problem persists and we can always reopen this 👍
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.
Best
The text was updated successfully, but these errors were encountered: