1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
WordPress: updating the connection information for a MySQL database
Following a plan change for your site (migrating from the old v1 60 GB plan to the latest v2 100 GB hosting plan) you may have to update the connection between the MySQL database and your WordPress site (in order to avoid the "error establishing a database connection", for example).
Elements to be changed
Here is the information to be changed in the wp-config.php file so that your WordPress site will work (as a general rule, a prefix has simply been added before the existing database name and user name):
- the MySQL database name (e.g., databasename before, abcd_databasename after)
- the host server of the MySQL database (e.g., mysql.yourdomain.ch before, abcd.myd. infomaniak.com after)
- the name of the user accessing the MySQL database (e.g., userbdd before, abcd_userbdd after)
Modifying the WordPress wp-config.php file
- recover and preserve your current MySQL data according to the list above (help: https://www.infomaniak.com/en/support/faq/1981/my-sql-creating-a-databasemanaging-users
- create an FTP account: https://www.infomaniak.com/en/support/faq/1982/creatingeditingdeleting-an-ftp-account
- log in to FTP: https://www.infomaniak.com/en/support/faq/1130/ftp-manager-accessing-the-ftp-serveron-line-file-manager
- edit the wp-config.php file that is located in your WordPress root folder
- find the paragraph concerned and update the 3 items of information (according to the list above)
- back up the file and that's all, your WordPress will now connect to the correct database
Link to this FAQ: