Hello everyone,
I am experiencing an issue with my NethServer 8 after installing the Webserver and MariaDB modules. After a server reboot, I receive the following error in WordPress:
“Error establishing a database connection”
I have already verified that the .config file (wp-config.php) is correctly configured, and in phpMyAdmin, I can access and view the WordPress databases without any issues. However, the site is unable to connect to the database.
Has anyone experienced something similar or knows how to resolve this? What could be causing the issue?
Thanks in advance for your help!
Here’s a wp-config.php to compare. Please check the DB_HOST, if the wireguard IP and the port (from NS8 mariadb status page) are correct.
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );
/** Database username */
define( 'DB_USER', 'wordpress' );
/** Database password */
define( 'DB_PASSWORD', 'wordpress' );
/** Database hostname */
define( 'DB_HOST', '10.5.4.1:20029' );
/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );
/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
Maybe there’s an issue regarding the wordpress db user? You may test by connecting to mariadb as wordpress user to show the wordpress tables on CLI: