Re: Database unreachable unless I start the MYSQL Workbench
Posted by: Peter Brawley
Date: October 12, 2018 09:58AM

Quote

The Screenshots clarify what I mean, because you keep asking about PHP which has nothing to do with the issue itself.

Non sequitur.

Quote

And of course it is possible to connect to the database with the root user, why shouldn't it be?

?! Your connection issue has many possible causes; they need to be ruled out if you want the problem solved.

> Yesterday, when everything was running, I restarted the MySQL service and got the same error.

Starting the MySQL service elicited an error? Let's see that exact error message.

> why do you keep asking about PHP scripts?
> Do you assume that a PHP script hinders a proper DB connection?

?! Because you've said the customer connects to the MySQL instance via PHP.

Quote

Our customer/guest does not connect to anything. They just edit their stuff in wordpress and everything besides (the backend you could say) is hosted on OUR VM which WE MANAGE. The customer has nothing to with it and do not need to connect to any instance whatsoever, it all is managed from our side.

Are you unaware WordPress is a set of PHP scripts that in this case connect to the MySQL instance on your VM via the PHP MySQL API?

Quote

If you try to open their webshop, the error is: "Failed to establish a database connection" (as soon as I start the WB, the database is instaly reachable)

By "webshop" you mean the WordPress script, or something else?

"Failed to establish a database connection" is a WordPress error message for the user. You need to find the underlying error message from the MySQL API. It'll probably be in a WordPress error log. More info may be in the PHP error log. Let's see the relevant exact error messages you find there.

We also need to see the connection info WP is using, it's in wp-config.php in the WordPress installation.

Quote

I thought the "autostart workbench" option will suffice, but unfortunately it is not since you are forced to open the SQL Editor.

All right, that may help.

When a VM opens, it acquires an IP address that becomes associated with the VM name. The ip address varies from connection to connection, the name stays the same. So, we need to see the WP connection specs. Also what exactly must you do in the WB SQL Editor to enable connection via WordPress?

Options: ReplyQuote




Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.