Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Resolve an interruption between Joomla and the database
This guide details the error "Database connection error: could not connect to mysql" that may occur when making changes around an Infomaniak hosting on which the Web app Joomla is installed.
Preamble
- To get the site working again, you need to check and update some information in the Joomla
configuration.phpfile:- The name of the MySQL database β this is often a prefix that has been added before the existing database name and the username (for example
bddnamebefore,abcd_bddnameafter). - The MySQL database host server (for example
mysql.domain.xyzbefore,abcd.myd.infomaniak.comafter). - The username that accesses the MySQL database (for example
userbddbefore,abcd_userbddafter). - The path of two directories
/tmpand/logs:
- The name of the MySQL database β this is often a prefix that has been added before the existing database name and the username (for example
Obtain updated information
For points 1, 2 and 3 of the preamble above:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product in question.
- Click on Database in the left sidebar.
- Find and keep your current MySQL information (need help?).
For point 4 of the preamble above:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product in question.
- Click on Manage under Advanced settings:

- Under the PHP | Apache tab, under PHP Information click on Show Information.
- At the line _SERVER['DOCUMENT_ROOT'] copy the path to the right:

Modify the Joomla configuration.php file
Prerequisites
- Create an FTP account (need help?).
- Connect via FTP (need help?).
Then edit the configuration.php file which is in the root folder of your Joomla:
- Find the relevant paragraph and update the 4 pieces of information in the preamble above.
- Also replace the old path (including "
www") with the new path:

- Save the file; your Joomla will now connect to the correct database.
Check the changes made
On the Joomla interface, it is possible to check the paths of the /logs and /tmp folders:
- For the
/logsfolder: go to System / Configuration then System - For the
/tmpfolder: go to System / Configuration then Server
Link to this FAQ: