Database connection to WordPress

Hello,
I've searched as much as I can and I think I've done what's needed, but it's not working.
I installed WordPress directly via FileZilla (I read here that it's better than the one‑click module). But I can't connect to the database.

Here's what I did directly in the wp-config-sample.php file, based on my database name on OVH (screenshot below). Why do I still get the Error establishing a database connection error?

Thanks in advance for your help, I'm struggling

// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'euszaaimtricart' );

/** Database username */
define( 'DB_USER', 'euszaaimtricart' );

/** Database password /
define( 'DB_PASSWORD', '
**' );

/** Database hostname */
define( 'DB_HOST', 'mysql623.eu004' );

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

Hello @Muriel

Error:

/** Database hostname */
define( 'DB_HOST', 'mysql623.eu004' );

It should be:
NomBase.mysql.db

See my guide:
https://wordetweb.com/word-et-web/WORDPRESS-guide-installation-de-WordPress-premier-domaine-chez-OVH-FR.htm#_N2__-

Hello @Muriel,

If it’s a fresh WordPress installation, you should let it ask for the database connection information by opening the site directly in a browser; it will fill in the proper files.

If the database already exists and it’s a migration, the wp-config-sample.php file isn’t the right one anyway. The correct one is wp-config.php

Hello,

Thank you very much for your replies.

I'm not starting from nothing; I just have a domain http://murieltricart.fr/ and a hosting http://murielg.cluster129.hosting.ovh.net/ that aren't even linked.

I can't install WordPress, neither via FileZilla nor with one‑click. It always says there is an error.

I tried deleting my database and everything on the hosting and starting from scratch, but it doesn't work.

Could you show me the proper procedure? Thank you immensely!!

Hello,

If I may give you a piece of advice, go back to your client area > Web Cloud > Hosting > Multisite

On the two lines murieltricart.fr and www.murieltricart.fr, you probably set (nothing) or “.” in “root folder”. Change the settings to put www there because that’s where your WordPress is

Then you must ban “http://murielg.cluster129.hosting.ovh.net/” from any configuration. Use only your domain name. Period.

It is likely you’ll need to delete the WordPress that is currently installed and start from scratch.

If you have no knowledge and no one to help you “live”, install an OVH module even if it isn’t perfect.

It’s a bit of smoke and mirrors in the long term, because it masks all the “maintenance” part that you will later forget to do.

You’re too nice.

I therefore put www in place of the dot.

Then I deleted the current database and everything that was on the hosting via FileZilla.

I’m reinstalling WordPress with one click. I’ll get back to you to let you know if it’s good. Thanks

I get the impression that you have correctly replaced the root folder, but what you put does not seem to be “www” in lowercase.

And if you went through the first nine paragraphs of my guide step by step.

You would set up your site on the first try.

Hello all three,

I struggled with two-factor authentication but I managed to log back into my account.

I'm floundering, I feel useless, I don’t understand. I went back to Gaston's guide but my site doesn’t show up. I must have missed something.

Actually, I can’t connect to my database

I changed the password, I fill everything in correctly and I still get the same message

I tried via FileZilla with the wp-config.php file

Here is the response:

I read on the image mysql628.eu004 and not mysql623.eu004

Hello @Muriel

To resolve the database‑connection issue on your site, please follow these steps:

Step 1 of 5: Click your domain under the “Hosting” section.
Step 2 of 5: Go to “Databases”.
Step 3 of 5: Click the three dots to the right of your database and select “Change password”.
Step 4 of 5: Enter the new password, re‑type it in the “Confirmation” field, then confirm.

Attention, the password must meet the following conditions:
- Minimum 8 characters
- Maximum 30 characters
- At least one uppercase letter
- At least one lowercase letter
- At least one digit
- Must consist only of letters and numbers

Step 5 of 5: Insert this new password into the WordPress configuration file:

• Click your domain under the “Hosting” section.
• Open the “FTP‑SSH” tab.

In the client area you will find all the information needed to access FTP, except the password (which is hidden for obvious security reasons). If you do not know the FTP password, you can change it by clicking the three dots at the bottom of the page. The password criteria are the same as above.

Once you are connected to your hosting’s FTP, edit the wp‑config.php file located in the www folder and modify the line that contains your database password to the new one.

For more information: https://help.ovhcloud.com/csm/fr-web-hosting-change-database-password?id=kb_article_view&sysparm_article=KB0053056

If you prefer to start a fresh installation from scratch without worrying about the link between hosting and database, follow these steps:

  1. Delete the module:

Step 1 of 3: Click your hosting under the “Hosting” section.
Step 2 of 3: Click “...” to the right of the relevant module.
Step 3 of 3: Click “Delete module”.

  1. Delete the existing database:

Step 1 of 4: Click your hosting under the “Hosting” section.
Step 2 of 4: Go to the “Databases” tab.
Step 3 of 4: Click “...” to the right of the existing database.
Step 4 of 4: Click “Delete database”.

  1. Remove the contents of the www folder on your hosting.

  2. Update the PHP version of your hosting (optional if already up‑to‑date):

Step 1 of 4: Log in to your client area and click “Webcloud” in the top menu.
Step 2 of 4: Then click “Hosting”, followed by the name of your hosting.
Step 3 of 4: You can then click the three small dots next to “Global PHP version” and choose “Edit configuration”.
Step 4 of 4: Select “Edit current configuration” and click “Next”.

For the configuration, I recommend the following settings:

• Runtime environment: stable64
• PHP version: 8.5
• Engine: PHP
• Mode: Development
• Application firewall: Disabled
  1. Launch the one‑click module installation:

Step 1 of 4: Click your domain under the “Hosting” section.
Step 2 of 4: Go to the “One‑click modules” tab and click “Add a module”.
Step 3 of 4: Choose the desired module, select your domain name, and click “Install”.
Step 4 of 4: Wait about fifteen minutes for the installation to complete.

You will then receive an email with the credentials; the password will be visible by clicking the link in the email, which remains valid for 48 hours from the time you use it.

For more info: https://help.ovhcloud.com/csm/fr-web-hosting-1-click-module-setting-up?id=kb_article_view&sysparm_article=KB0052406

Asterix

Hello,

Let's proceed methodically:

The three pieces of information (except the password) are grouped here. As Asterix indicated, reset the password and you’ll then have the four items needed to identify your database.

That makes me think the wp‑config.php you’re trying to edit isn’t the one your site uses:

image

Do you have two WordPress installations on your hosting?

I’ve got these four items,

The file in the wp that I installed was named wp-config-sample

// ** Database settings - You can get this info from your web host ** //
/
* The name of the database for WordPress /
define( 'DB_NAME', 'database_name_here' );

/* Database username /
define( 'DB_USER', 'username_here' );

/* Database password /
define( 'DB_PASSWORD', 'password_here' );

/* Database hostname /
define( 'DB_HOST', 'localhost' );

/* Database charset to use in creating database tables. /
define( 'DB_CHARSET', 'utf8mb4' );

/* The database collate type. Don’t change this if in doubt. /
define( 'DB_COLLATE', '' );

I replaced it with wp-config as it said

I’m going to start from scratch as Asterix recommends and reinstall the one‑click module (but I tried and it’s still the database that’s the problem).

Hello

Probably because you aren't providing the requested information correctly.
You must use the three pieces of information given by @fritz2cat plus the password

Your wp-config.php should be filled out like this.

Damn, it’s good, the database is recognized when I go through FileZilla, I changed the config file again.

I think I got the host name and user mixed up.

Wordpress is being installed. I’m not shouting victory yet; for now I still have to set up the SSL file for https.

Thank you a thousand times for the time you’ve given me.

Exactly, I'm sorry for making you waste time with this slip‑up :unamused_face:

But your advice was really helpful.

One more thing: your hosting that contains WordPress: is it on cluster121 (which returns a 503 error) or on cluster129?

In the second case, your DNS zone is not correct.

It is indeed on cluster121

Thanks again to you