Error establishing a database connection – LightSail – WordPress MultiSite – Bitnami
The Error
When you try and go to MySites>NetworkAdmin>Sites.
You get the error below.
Error establishing a database connection
If your site does not display, please contact the owner of this network. If you are the owner of this network please check that MySQL is running properly and all tables are error free.
Could not find site wordpress.rapturezone.com. Searched for table wp_blogs in database bitnami_wordpress. Is that right?
What do I do now? Read the Debugging a WordPress Network article. Some of the suggestions there may help you figure out what went wrong. If you’re still stuck with this message, then check that your database contains the following tables:
wp_users
wp_usermeta
wp_blogs
wp_blogmeta
wp_signups
wp_site
wp_sitemeta
wp_registration_log
Possible Cause
When running
sudo /opt/bitnami/bncert-tool
As described in Adding New TLS Website to WordPress MultiSite Bitnami Instance.
An important entry in the following database is over written.
- Database:bitnami_wordpress
- Table:wp_blogs
- Colum:Domain
To inspect you can issue the following commands. From a ssh session on the database server. The username and password can be found in /opt/bitnami/apps/wordpress/htdocs/wp-config.php on the application server.
mysql -u bn_wordpress -p
mysql> SHOW DATABASES;
mysql> SHOW TABLES;
mysql> select * from wp_blogs;
+---------+---------+-------------------------------+------+---------------------+---------------------+--------+----------+--------+------+---------+---------+ | blog_id | site_id | domain | path | registered | last_updated | public | archived | mature | spam | deleted | lang_id | +---------+---------+-------------------------------+------+---------------------+---------------------+--------+----------+--------+------+---------+---------+ | 1 | 1 | wordpress.rapturezone.com | / | 2099-02-20 19:18:28 | 2099-06-28 18:07:14 | 1 | 0 | 0 | 0 | 0 | 0 | +---------+---------+-------------------------------+------+---------------------+---------------------+--------+----------+--------+------+---------+---------+
Possible Fix
Known Solution
sudo /opt/bitnami/bncert-tool
Re-Run for the main/parent/root website.
Unstested Alternative Solution
Update the database entry for
bitnami_wordpress>wp_blogs>Domain
Related
- Backup & Restore Bitnami WordPress MultiSite
- Remove Bitnami Banner Bottom Right WordPress MultiSite
- WordPress MultiSite Bitnami Essentials