Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Solve a break between WordPress and MySQL
This guide concerns users who make changes around a hosting on which WordPress is installed.
Preamble
- Following a change of offer of your web hosting (migration from the old hosting formula v1 60GB to the current offers) it is possible that you should update the connection between the MySQL/MariaDB database and your WordPress site (in order to avoid the error "
error establishing a database connection
" e.g.) and thus restore the link between WordPress and the MySQL/MariaDB database.
Modifying important elements
Here is the information to adapt in the file wp-config.php
so that your WordPress site works (usually, a prefix has simply been added in front of the existing database name and username):
- the name of the MySQL database (bddnamebefore, abcd_bddname after e.g.)
- the host server of the MySQL database (mysql.domain.xyzbefore, abcd.myd.infomaniak.com after e.g.)
- the username that accesses the MySQL database (userbddbefore, abcd_userbdd after e.g.)
Edit File wp-config.php WordPress
To this end:
- Find and store your current MySQL information according to the above list.
- Create an FTP account.
- Log in to FTP.
- Edit file
wp-config.php
which is in the root folder of your WordPress site. - Find the relevant paragraph and update the 3 information (according to the list above).
- Save the file and that's it, your WordPress will now connect to the correct database!
Link to this FAQ: