Question

MySQL suddenly started failing

Hi guys,

I’ve ran into trouble and I want to fix it on my own however I would pretty much need some pointers.

My MySQL service went down and I’m unsure on how to start troubleshooting it.

Can you guys assist?


Submit an answer


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!

Sign In or Sign Up to Answer

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.

KFSys
Site Moderator
Site Moderator badge
September 4, 2019
Accepted Answer

Hi @Remdore,

Your questions is quite generic but I’ll try and lend you some pointers on which you can start.

Check Disk Space

If your droplet is full, services like mysql,apache,nginx etc. will start failing as they can’t create the proper sockets to start themselves.

Check the current disk usage

df -h

That will show you all your partions and the size they are using. If your server is full let me know and I’ll provide you with pointers on what to check and clear.

Now onto the good stuff

**Your MySQL might have been corrupted. **

In order to check that, you can check your mysql error log. Your error log should be defined in your my.cnf file. If you are not sure where it is, you can do the following

locate my.cnf

It’s usually at /etc/my.cnf

Once you find it, open it with your favourable editor and see if there is a line like

 [mysqld]
 log_error = /var/log/mysql/error.log

If there isn’t try adding the line and restarting MySQL.

Once you do, the error log should appear and it should say what the problem is.

If you run into trouble, post the contents of it and I’ll help out.

Kind regards, Kalin D.

I managed to start MySQL but in the log it says that a table has crashed on my DB.

Should I just go and try to repair it or is there something else to be done?

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

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.