Restore Another Website

https://cryptofxmasters.com

Error establishing a database connection

This either means that the username and password information in your wp-config.php file is incorrect or that contact with the database server at localhost could not be established. This could mean your host’s database server is down.

  • Are you sure you have the correct username and password?
  • Are you sure you have typed the correct hostname?
  • Are you sure the database server is running?

If you are unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress support forums.

This is the problem showing up.
I add the database of crypto and all files through Filezilla. Now it is this problem which I want to be fixed.

This makes sense, because the database hostname isn’t localhost on our hosting.

When migrating a site from one hosting to another, you’ll need to do three things:

  1. Copy the files.
  2. Copy the database.
  3. Update your website config for the new hosting, especially the database configuration.

You appear to have done 1 and 2, but not 3. So please update the database credentials in the wp-config.php to match the credentials shown in the client area on the MySQL Databases page.

6 Likes

plz tell me the 3d how to do it and will do.

Find wp-config.php and open it with a suitable editing program- even something like Notepad ++ would do, since you’re just making a simple change. Once you’re in the file, find the section on MySQL settings (example provided) and change each option to the information that matches your account with InfinityFree, which like the admin said can be found in your client area.
how-to-change-wordpress-database-password-in-cpanel-wp-config-1024x512.jpg

If you need further guidance you can find a walk through on this process here: https://www.knownhost.com/kb/how-to-update-your-wp-config-php-file-with-a-new-database-password/

7 Likes

Now I have this problem after I did as you said.

6 Likes

I do not find any debug line there in wp_config, What should I do?

The WP_DEBUG line should be present in the wp-confip.php file. You can find it in this spot: https://github.com/WordPress/WordPress/blob/master/wp-config-sample.php#L82

If you’re sure the WP_DEBUG line isn’t there, you can just add a new one: Debugging in WordPress – Documentation

5 Likes

I do not find the debug line, also I added and it is nothing yet. Still the same problem.

this picture shows up again.

Hi SashaMaltese,

Your website shows the error message because you encountered error code 500, which means PHP crashed when it encountered a code error. It can be something as small as formatting or missing colon, or as big as some logic error.

Please try to resolve by checking throughly the wp-config file (since you have edited it), to see if you have declaried WP_DEBUG twice or has syntax error like missing/mismatching quotes or ;s .

Once that’s checked, please reply and we’ll proceed to enabling WP_LOG if necessary.

Cheers!

3 Likes

I see you added it. However, you added it within a comment, so it won’t do anything there. If you place code between /* and */, then it’s a comment and it won’t be executed.

Please put the code somewhere it will actually be executed. All the way at the top of the file, on the first line after the <?php tag, is fine.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.