Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real MySQL error not shown #146

Closed
carliedu opened this issue Nov 19, 2021 · 1 comment
Closed

Real MySQL error not shown #146

carliedu opened this issue Nov 19, 2021 · 1 comment
Milestone

Comments

@carliedu
Copy link

carliedu commented Nov 19, 2021

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

@carliedu carliedu changed the title Real MySQL error no shown Real MySQL error not shown Nov 19, 2021
@clue clue added this to the v0.5.6 milestone Nov 25, 2021
@clue
Copy link
Contributor

clue commented Nov 25, 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 👍

@clue clue closed this as completed Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants