Knowledge base

1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!

Troubleshooting connection issues between Joomla and the database

Update 08/07/2026

This guide details the "Database connection error: could not connect to mysql" error, which may occur when making changes to an Infomaniak hosting environment on which the Joomla web application is installed.

 

Introduction

  • To get the site working again, you need to check and update certain information in the configuration.php file of Joomla:
    1. The database name — this is often a prefix that has been added to the existing database name and username (for example, dbname before, abcd_dbname after).
    2. The host server of the database (for example, mysql.domain.xyz before, abcd.myd.infomaniak.com after).
    3. The username that accesses the database (for example, dbuser before, abcd_dbuser after).
    4. The path to two directories, /tmp and /logs.

 

Get the updated information

For points 1, 2 and 3 of the preamble above:

  1. Click here to access the management of your product on the Infomaniak Manager (need help?).
  2. Click directly on the name assigned to the product in question.
  3. Click on Database in the left-hand menu.
  4. Find and save your current MySQL information (need help?).

Regarding point 4 of the introduction above:

  1. Click here to access the management of your website in the Infomaniak Manager (need help?).
  2. Click directly on the name assigned to the website in question:
  3. Click on Manage advanced settings:
  4. Click on the PHP / Apache tab:
  5. Copy the path displayed in the first field under Auto Prepend File at the bottom:

 

Modify the configuration.php file in Joomla

Prerequisites

Then, edit the configuration.php file, which is located in the root directory of your Joomla:

  1. Replace the old log and tmp paths with the new path:
  2. Find the relevant paragraphs for the rest of the information in the introduction above:
  3. Save the file; your Joomla will now connect to the correct database.

 

Check the changes made

In the Joomla interface, you can check the paths of the /logs and /tmp folders:

  • For the /logs folder: go to System / Configuration then Logs:
  • For the /tmp folder: go to System / Configuration, then Server:

Has this FAQ been helpful?