Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Resolve a disconnect between Joomla and MySQL
This guide is for users making changes to an Infomaniak hosting environment where Joomla is installed.
Preamble
- If you need to update the connection between the MySQL database and your Joomla site (to avoid the error "
Database connection error: could not connect to mysql
" for example), this procedure details how to do it. - Often it is a prefix that has simply been added in front of the existing database name and the username.
Elements to modify
Here is the information to update in the configuration.php
file to make your Joomla site work:
- The name of the MySQL database (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 the following two directories:
/tmp
and/logs
Modify the Joomla configuration.php file
To do this:
- 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 the Advanced Settings button.
- Under the PHP tab, click on PHP Information.
- On the line _SERVER['DOCUMENT_ROOT'] copy the path on the right
- In the left sidebar, click on Databases.
- Find and keep your current MySQL information according to the list above (need help?).
- In the left sidebar, click on FTP/SSH.
- Create an FTP account (need help?).
- Log in via FTP (need help?).
- Edit the configuration.php file located in the root folder of your Joomla.
- Find the relevant paragraph and update the 4 pieces of information (according to the list above).
- Do not forget to replace the old path (including "
www
") with the new path:
- Save the file and that's it, 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 System - For the
/tmp
folder: go to System / Configuration then Server
Link to this FAQ: