Make WordPress Core

Opened 6 weeks ago

Last modified 6 weeks ago

#65034 new enhancement

More help for trouble shooting initial Database problems

Reported by: ralatalo's profile ralatalo Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.9.4
Component: General Keywords:
Focuses: Cc:

Description

Once you have enabled debugging in wp-config.php you get more information about database connection failure but maybe I missed a toggle because I didn't get a 'good' error message till I though together my own small PHP script which included:
if (mysqli_connect_errno()) {

printf("Connect failed: %s\n", mysqli_connect_error());
exit();

}

Where I finally got: mysqli_real_connect(): (HY000/2002): Permission denied

My Suggestion would be to Increase the diagnostic output once debugging is enabled, in particularly, to include something like:

The connection request below processed your configuration data as follows:
mysqli_real_connect( {DBhandle} , host, dbuser, dbpassword, database, port, socket, client_flags );
as host=’xxx’, dbuser=’xxxx’, dbpassword=’xxxxx’, database=’xxxxx’ , port=’xxxx’ , socket=’xxxxx’

And something showing the reported error:
Currently you show something like:

This either means that the username and password information in your %1$s file is incorrect or that contact with the database server at %2$s could not be established. This could mean your host’s database server is down.'

Then ask them if they are sure that they have the correct username and password, and correct hostname and if the database is running. Which I honestly found a little frustrating as I was alternating between hacking class-wpdb.php to figure out how you processed my entries and logging into mariadb directly using those same options.

Change History (2)

#1 @ralatalo
6 weeks ago

Note 1): I also filed Enhancement Request #65033 for adding a comment to wp-config-sample.php
for the format for DB_HOST which is what lead me to suspect I might have had some incorrect comment.
Note 2) Once I got my error message I was able too find:https://wordpress.org/support/topic/first-time-install-issue-error-hy000-2002/ which let me to SELinux Policies and a solution.

This Enhancement request is to assist in reducing the time others spend troubleshooting a similar issue.

#2 @mindctrl
6 weeks ago

Somewhat related to https://core.trac.wordpress.org/ticket/63678 in that it involves improving database error messaging.

Note: See TracTickets for help on using tickets.