Report this

What is the reason for this report?

Database Connection Error

Posted on February 22, 2020

Hi, In my website my mysql server sometimes stopping unexpectedly. After some page refreshes then the page will appear. In have changed innodb_buffer_pool_size=20M in my.cnf file.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello, @santsfirm

What you definitely need to do is to examine the MySQL error log and track down any logged errors. The location of the MySQL error log should be:

/var/log/mysql/error.log

but you can also use this command via ssh and it will show you the location of the MySQL error_log:

mysql -se "SHOW VARIABLES" | grep -e log_error

You can check if the droplet/server is not exhausting the memory, a way to check this is using htop / top or free -m

When the issue occurs you can quickly check the memory usage and examine the MySQL error_log as well. If you do not expect a lot of traffic or busy MySQL activity then the error should be logged in the log.

Hope this helps. Let me know how it goes.

Regards, Alex

innodb_buffer_pool_size=20M might be problematic. What’s the droplet size? Have you been able to dig up anything in the error log?

A

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.