Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Resolve a disconnect between Joomla and MySQL
This guide details the error "Database connection error: could not connect to mysql
" which may occur during modifications 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 certain information in the Joomla
configuration.php
file:- The name of the MySQL database — this is often a prefix that has been added in front of the existing database name and the username (for example
bddname
before,abcd_bddname
after). - The MySQL database host server (for example
mysql.domain.xyz
before,abcd.myd.infomaniak.com
after). - The username that accesses the MySQL database (for example
userbdd
before,abcd_userbdd
after). - The path of two directories
/tmp
and/logs
:
- The name of the MySQL database — this is often a prefix that has been added in front of the existing database name and the username (for example
Get the updated information
For points 1, 2 and 3 above:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the concerned product.
- Click on Database in the left sidebar.
- Find and keep your current MySQL information (need help?).
For point 4 in 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 concerned product.
- Click on Manage under Advanced settings:
- Under the PHP | Apache tab, under PHP Information, click on Display Information.
- On 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 file configuration.php located in the root folder of your Joomla:
- Find the relevant paragraph and update the 4 pieces of information from 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 folders /logs
and /tmp
:
- For the
/logs
folder: go to System / Configuration then System - For the
/tmp
folder: go to System / Configuration then Server
Link to this FAQ: