⁉️Common WordPress Installation Errors

Here are the most common reasons and fixes:


βœ… 1. Wrong database name, user, or password

Check your wp-config.php file inside /var/www/html/wordpress/:

define( 'DB_NAME', 'wp_lab' );
define( 'DB_USER', 'wp_user' );
define( 'DB_PASSWORD', 'password' );
define( 'DB_HOST', 'localhost' );
  • Make sure these match exactly what you created in MariaDB.

  • If you used a different name/password, fix it here.


βœ… 2. MariaDB is not running

Check the status:

sudo systemctl status mariadb

If stopped, start it:

sudo systemctl start mariadb

βœ… 3. User doesn’t have permissions

Log in to MariaDB:

Then re-grant privileges:


βœ… 4. Wrong DB host

In most local labs, DB_HOST should be:

But in Docker setups, it might be mariadb or the container name. Check with:


βœ… 5. Socket issues

Sometimes WordPress expects TCP (127.0.0.1) instead of the MariaDB socket. Try editing wp-config.php:


βœ… 6. Test the database connection manually

From terminal:

If this works, then the problem is only in wp-config.php. If it fails, the user or DB is misconfigured.

Last updated