Skip to content

Real MySQL error not shown #146

@carliedu

Description

@carliedu

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy