Changing the password for a Web Hosting plan’s database
Find out how to change the password for a database created as part of a Web Hosting plan
Find out how to change the password for a database created as part of a Web Hosting plan
Last updated 15rd February 2023
Most websites use a database to store their articles, comments, or users' email addresses.
You can connect to this database using a configuration file contained in the file storage space on your Web Hosting plan. It contains credentials that allows your website to access its database server.
The password change for a database must therefore always be carried out in two places:
In your website’s configuration file via the FTP space on your Web Hosting plan.
And on the server that contains their database, via the OVHcloud Control Panel.
Until this change is made in both locations, your site will display a "database connection error".
For this reason, if you would like to change your database password, you will need to carry out all of the operations listed in this guide. If you have any doubts about how to proceed, contact your webmaster or contact a specialised service provider.
There are four steps to changing your website’s database password:
This guide explains how to change a database password securely.
OVHcloud is providing you with services for which you are responsible, with regard to their configuration and management. You are therefore responsible for ensuring they function correctly.
This guide is designed to assist you in common tasks as much as possible. Nevertheless, we recommend that you contact a specialist service provider and/or discuss the issue with our community on if you have difficulties or doubts. You can find more information in the Go further section of this guide.
In the OVHcloud Control Panel, click on Web Cloud
, then on Hosting plans
and finally the hosting plan concerned. Then go to the Multisite
tab. Identify the name of your site's Root folder
(the directory in which its files and folders are located).
Then click on the FTP-SSH
tab and go to the space containing your website’s files and folders (the FTP space) by clicking FTP Explorer
.
If you would like to change the password on your FTP space, please refer to this guide.
If you would like to use another method to log in, please refer to this guide.
Open the Root folder
identified previously.
Locate and open your site's configuration file:
There are two possible cases:
To determine which case applies to your website, in the configuration file identified in step 1, start by noting down the name of its database:
Then go back to the OVHcloud Control Panel and open the Web Cloud
section:
Hosting plans
section, then to the Web Hosting plan concerned.Databases
tab on the right-hand side of your screen.Database Name
column.If you have found the database name listed in the configuration file in this section of the OVHcloud Control Panel, go to step 3.
Otherwise, your website’s database is linked to a Web Cloud Databases solution.
You will need to go back to your website’s configuration file to note the server name and database username:
Then click in the Databases
section of the Web Cloud
section.
For Web Cloud Databases solutions, open the tab General information
. Check for the database server name identified previously under Host name
.
In this section of the OVHcloud Control Panel, go to the Users and rights
tab to find your database’s Username
.
For more information on password management best practices, follow the instructions in this guide.
Choose the new password for your database and save it. It must meet the following conditions:
As described in step 1, go back to your Web Hosting plan’s file storage space, then open your website’s configuration file for editing.
Before you make any changes, save the content of this file locally in a text document, so that you keep a copy if you make any mistakes.
Manually replace your database password while avoiding changing or deleting any other elements of the configuration file (in the extracts below, only the sample password *0VhCloudPa55w0rdDB123*
should be replaced):
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'dbname123');
/** MySQL database username */
define('DB_USER', 'dbname123');
/** MySQL database password */
define('DB_PASSWORD', '0VhCloudPa55w0rdDB123');
/** MySQL hostname */
define('DB_HOST', 'dbname123.mysql.db:3306');
public $host = 'dbname123.mysql.db:3306';
public $user = 'dbname123';
public $password = '0VhCloudPa55w0rdDB123';
public $db = 'dbname123';
$databases['default']['default'] = array (
'database' => 'dbname123',
'username' => 'dbname123',
'password' => '0VhCloudPa55w0rdDB123',
'prefix' => 'prefix123_',
'host' => 'dbname123.mysql.db',
'port' => '3306',
'database_host' => 'dbname123.mysql.db',
'database_port' => '3306',
'database_name' => 'dbname123',
'database_user' => 'dbname123',
'database_password' => '0VhCloudPa55w0rdDB123',
Save this change.
This operation will take a few minutes to take effect. Once you have launched it, check its status in the Ongoing tasks
tab.
Again, two cases are possible:
If your database is located in the section of the OVHcloud Control Panel that is dedicated to your Web Hosting plan, follow these instructions.
If your database is located in the section of the OVHcloud Control Panel dedicated to your Web Cloud Databases solutions, follow these instructions.
In the Hosting Plans
section of the OVHcloud Control Panel, go to the Databases
tab on the right-hand side of your screen:
Next, click on the three dots to the right of your website’s database, then on Change password
.
In the window that pops up, enter your database’s new password (defined at step 3), confirm it, then click on Confirm
.
Go to the Databases
section in your Control Panel and click on the server concerned, then click on Users and rights
:
To change the password for your database on the server, click on the three dots to the right of the Username
identified in step 2, then on Change password
.
In the window that pops up, enter your database’s new password (defined in step 3), confirm it, then click on Confirm
.
FileZilla software usage with your hosting
Troubleshoot common database errors
For specialised services (SEO, development, etc.), contact your OVHcloud partners.
Join our community of users on https://community.ovh.com/en/.
Please feel free to give any suggestions in order to improve this documentation.
Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.
Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.
Thank you. Your feedback has been received.
Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.
Discuss with the OVHcloud community