I getting "Error establishing database connection"

Keywords: WordPress - Google Cloud Platform - Technical issue - Other
bnsupport ID: defa54ae-6c7c-ce91-5908-6a7b4bbc3892
Description:
12 hours ago I noticed the website was very slow and sometimes getting error 524 (A timeout server).

So, I was many times stop and strat VM and change CPU and Memory. But, after that I got a new Error establishing database connection.

When I run the command: $ sudo /opt/bitnami/ctlscript.sh restart mysql

Unmonitored mysql
/opt/bitnami/mysql/scripts/ctl.sh : mysql not running
/opt/bitnami/mysql/scripts/ctl.sh : mysql could not be started
Monitored mysql

Also, any way to Backup the database and disable all plugins from the backend?

It’s urgent. Please help!

Hi @sarwar,
We have checked the logs and seems that something went wrong. Could you please describe what happened before the error? Did you change something? Were you trying to configure something?

The log is the following, you can find the complete file under /opt/bitnami/mysql/data/mysqld.log:

  1 2019-11-19T18:50:41.516726Z 25332 [ERROR] [MY-011072] [Server] Binary logging not possible. Message: An error occurred during flush stage of the commit. 'binlog_error_action' i>
  2 18:50:41 UTC - mysqld got signal 6 ;
  3 Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
  4 Thread pointer: 0x7fb1d43b88b0
  5 Attempting backtrace. You can use the following information to find out
  6 where mysqld died. If you see no messages after this, something went
  7 terribly wrong...

In the mean time, I would at least copy the data folder just in case the error is not recoverable.

When I was stop and start VM many times then showing this error. Before stopping and starting VM, website was very slow, 30 minutes before stopping VM.

Also, is it possible to disable (deactivate) all plugins at once?

Hi @sarwar,
To do that you can rename the /plugin folder using the mv command.

mv plugin plugin.disable 

Showing error: $ mv plugin plugin.disable
mv: cannot stat ‘plugin’: No such file or directory

Please help to get back our website.

Also, how can I get backup file of 6 PM, 19/11/2019?

Hi @sarwar,
Sorry for the confusion, I pasted a general command just to show how to move a directory. The plugins directory for the bitnami wordpress stack is /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins. So, the exact command is:

sudo mv /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins.disabled

Regarding the backups, this guide show you how to do a backup, but if you don’t have that directory in the state of that date you won’t be able to backup it, for the future it is a good practice to create backups more often:
https://docs.bitnami.com/installer/apps/wordpress/administration/backup-restore/

Command working. But, the problem still the same.

Please help to resolve, error establishing database connection.

When I run the command: $ sudo /opt/bitnami/ctlscript.sh restart mysql

Unmonitored mysql
/opt/bitnami/mysql/scripts/ctl.sh : mysql not running
/opt/bitnami/mysql/scripts/ctl.sh : mysql could not be started
Monitored mysql

Please help!

I’m waiting for your reply. Please reply!

Hi, @sarwar.

Looking at your logs, it looks that you ran out of space:

2019-11-19T18:55:13.447895Z 0 [System] [MY-010931] [Server] /opt/bitnami/mysql/bin/mysqld.bin: ready for connections. Version: '8.0.17'  socket: '/opt/bitnami/mysql/tmp/mysql.sock'  port: 3306  MySQL Community Server - GPL.
2019-11-19T18:55:13.567598Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/tmp/mysqlx.sock' bind-address: '::' port: 33060
2019-11-19T18:55:46.793597Z 17 [ERROR] [MY-000035] [Server] Disk is full writing './binlog.000023' (OS errno 28 - No space left on device). Waiting for someone to free space... Retry in 60 secs. Message reprinted in 600 secs.
2019-11-19T19:05:46.858134Z 17 [ERROR] [MY-000035] [Server] Disk is full writing './binlog.000023' (OS errno 28 - No space left on device). Waiting for someone to free space... Retry in 60 secs. Message reprinted in 600 secs.
[...]
2019-11-19T20:12:22.315362Z 17 [ERROR] [MY-010907] [Server] Error writing file 'binlog' (errno: 28 - No space left on device)
2019-11-19T20:12:22.315597Z 17 [ERROR] [MY-011072] [Server] Binary logging not possible. Message: An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'ABORT_SERVER'. Hence aborting the server..

In fact, I can see your disk is full:

-----------------------------------
Check free amount of disk space
-----------------------------------
Running: df -h
In: /opt/bitnami

Output:

Filesystem      Size  Used Avail Use% Mounted on
udev            3.0G     0  3.0G   0% /dev
tmpfs           598M   17M  581M   3% /run
/dev/sda1       9.8G  9.4G     0 100% /
tmpfs           3.0G     0  3.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.0G     0  3.0G   0% /sys/fs/cgroup

You can follow this guide to Increase the size of your server: https://docs.bitnami.com/google/faq/administration/resize-server-disk/

Regards,
Alejandro

1 Like

I increased disk space and run this command: $ sudo /opt/bitnami/ctlscript.sh start mysql
/opt/bitnami/mysql/scripts/ctl.sh : mysql could not be started
Monitored mysql

So, problem still same. Please help!

Did you restart your instance as the guide says at the end?

On the instance detail page, click the “Stop” button and wait for the instance to stop, then click the “Start” button to restart it.

If so, please run the Bnsupport tool again so we get your updated configuration.

Regards,
Alejandro

1 Like

Now working :slight_smile: thanks a lot!

Would you share with me, how can I check the free amount of disk space? That you checked.
Also, what consumes more storage?

Thanks again!

work for me. 5 days without web…

The command is df -h. Also, I can see that most of the space is used by the /opt/bitnami/mysql folder. You can check that folder to see what is taking the space.


Hi, @m.granero,

Do you mean that this post helped you? Or are you having issues with your site? If it’s the second one, please open a new thread so we can help you there.

Regards,
Alejandro

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