Wordpress instance cloning with a snapshot, database connection error. What to do?

0

I have a wordpress instance here on AWS Lightsail that works fine.

(I don't understand where to find the database, if I go to the instance menu under database, it is not present, yet the site works well :-) so it's there somewhere).

I can open the wp-config.php file from ftp and see that the first two data are:

define( 'DB_NAME', 'bitnami_wordpress' ); define( 'DB_USER', 'bn_wordpress' );

Having said that, I created a snapshot of this instance and inserted it in the same AWS Region but in another zone (Zone B)


If I try to connect to the new IP address I get the error: Error establishing a database connection I inspect and see that it is an error coming from wp:

<body id="error-page"> <div class="wp-die-message"><h1>Error establishing database connection</h1></div>...etc..

If I open the new instance via FTP and open the wp-config.php I notice that it is the same as the original instance with the same data.


There are 2 questions, How can I access the database of the original instance, How should I configure the new instance to fix the error?

PS:

I created the new instance to have a clone of my wordpress but it must also have a new database.

I want them to be completely independent.

Thanks for any help

asked 6 months ago169 views
1 Answer
0

Hello,

Sorry to see you're encountering this issue.

Instance created from snapshot of the Lightsail wordpress Instance should be clone of the original Lightsail wordpress Instance. If the Database of the wordpress is configured to point to the Local database in the instance, then both of the Instance(original and clone) should be independent of each other.

Answer for the error message is below.

This error likely means either the username/password combination for Wordpress connecting to the database set in wp-config.php is incorrect, or the database isn't running. Here are a few things I'd try:

  1. See if the database is running. You can use the command ps aux | grep mysql to see if there's a mysql process running.
  2. Check your wp-config.php file to ensure that the database credentials set there are correct.
  3. Check the instance's disk space (df -h) to ensure it's not full.

I hope those steps help you figure out the issue. Thank you for using Amazon Lightsail!

Thanks, Naveen

AWS
SUPPORT ENGINEER
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions