• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Fix : Hard Disk Full of MySQL Log Files, MySQL Failing to Start

By Abhishek Ghosh May 31, 2019 11:36 pm Updated on May 31, 2019

Fix : Hard Disk Full of MySQL Log Files, MySQL Failing to Start

Advertisement

Server hard disk full is quite common matter, especially on the cloud servers. Usual disk space allocated on common RAM size cloud server instance is 30-40GB. Bigger websites easily eat up 10GB space for the media files. System files including running applications take more than 10GB. And for WordPress, full hard disk will result showing up the infamous “Error Establishing a Database Connection” page. If your disk at 100% of usage then tries to free some space quickly by running (for Debian based distro) :

Vim
1
apt-get clean

That should be enough to start MySQL :

Vim
1
service mysql restart

It is quite important to keep the head cool during downtime. Within 2-6 hours downtime, you are not going to miss huge traffic. Downtime is obvious for any website using a dynamic programming language with MySQL. Even with several humans, Quora-like websites face downtime. These are the reasons behind thinking of serverless computing. These days, most of the webmasters have an Android smartphone. Even We have a list of SSH client apps for Android. We suggest the webmasters of WordPress installations running on unmanaged servers to login every 6 hourly, or at least monitor the site by loading the webpage. Facing MySQL database connection error, just SSH, try to restart MySQL. If you can everyday restart MySQL from SSH, it probably will not disturb. Various MySQL errors are common out of minor wrong configuration, badly coded plugins etc. Our present topic is hard disk full issue. However, these tips definitely help someone. With a full hard disk, a full reboot may result in failure of Apache to restart. Various odd errors will be reported which will deduct erroneous conclusions. The easiest way to detect hard disk full is by checking the web host’s control panel. When you know that hard disk has 1-2GB left, you must be careful. If the hard disk is not full and MySQL, Apache failing to start that needs Analyzing Unexpected Shutdown of the Cloud Server Instance and opening a ticket towards the web host informing the situation. MySQL can be configured to auto-restart but not always that fix works.

Advertisement

---

Check these locations for old log files eating up disk space :

Vim
1
2
3
/var/lib/
/var/lib/mysql
/var/log/

MySQL error log file often eats up few GB of space. You can easily empty one file with echo command by running command like this :

Vim
1
echo " " > mysql-error.log

Hard Disk Full of MySQL Log Files MySQL Failing to Start

You can check disk space used by a directory and it’s contented by running a command like :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
du -shc /var/*
 
<pre>
 
 
-s = summary
-h = human readable
-c = prints the total at the end
 
Files which ends with `.log` and tarballs. If you run `mysql --verbose --help | less` it will tell you about line 11 which `.cnf` file it will look for. You can also do `mysql --print-defaults` to show you how the configuration values it will use. This can also be useful in identifying just which config file it is loading. Running `mysqld --help --verbose` is dangerous. You can overwrite pidfile for the running instance! It is recommended to use with `--pid-file=XYZ`. So much said to add the below to `my.cnf` file :
 
<pre>
[mysqld]
expire_logs_days=3

You must not manually delete the mysql-bin files. Deletion of mysql-bin files depends on the backup strategy. The reason to keep the binary logs is to restore the database. If your database requires restoration, those files will help. If you perform a full backup every day and have 7 days binary logs, you can delete the past 4-6 days binary logs. It is not exactly easy to a complete newbie to decide. You need to ask mysqld to do that for you. mysql-bin.[index] keeps a list of all binary logs mysqld has generated. If you run (on MySQL command line after login) :

Vim
1
PURGE BINARY LOGS TO `mysql-bin.000014`;

That will erase all binary logs before mysql-bin.000014.

If you run :

Vim
1
PURGE BINARY LOGS BEFORE DATE(NOW() - INTERVAL 4 DAY) + INTERVAL 0 SECOND;

that will erase all binary logs before midnight 4 days ago.

Apache2 log files can go huge size. Always check /var/log/apache2 directory. Logs of this two software are commonly found to eat up 10GB or more space with time. Apache2 modules to Log HTTP POST Method will consume space. More security-related modules you’ll add, faster disk space likely to get consumed.

Tagged With mysql disk full , mysql disk space full fix , mysql filling up disk percentage after 3 hours , mysql housekeeping logs on windows , mysql purge binary logs after 4 hours , sql binary log housekeeping

This Article Has Been Shared 880 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Fix : Hard Disk Full of MySQL Log Files, MySQL Failing to Start

  • WordPress XML-RPC Attack & Fake PHP5-FPM Error

    WordPress XML-RPC Attack Can Bring DDoS Resulting in Random 502 PHP5-FPM Errors on Nginx Server or Can Make the Database Down. Here is Fix.

  • Setup SFTP Without Shell Access For WordPress, Cloud Server

    Often We Need To Host Account On VPS OR Cloud Server Where It Is Desired To Have A Setup SFTP Without Shell Access For WordPress Like cPanel.

  • How Google Cloud Platform is Compared to IBM, OVH, DO, Linode?

    How Google Cloud Platform is When Compared to Other Cloud Webhosts IBM, OVH, DO, Linode? Not surprisingly not cost effective in terms of bench-marking.

  • Install Apache Gearpump On localhost (Ubuntu, Windows 10 Bash, Mac)

    Apache Gearpump is a real-time big data streaming engine, it is event/message based. Here is How to Install Apache Gearpump On localhost or Cloud Server.

  • How To Install Memcached on Ubuntu Server And Configure WordPress

    Here Are The Steps On How To Install Memcached on Ubuntu Server 16.04, 18.04 And Configure WordPress To Optimize Page Loading Speed.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Get Audiophile-Grade Music on Your Smartphone March 25, 2023
  • Simple Windows Security and Privacy Checklist for 2023 March 24, 2023
  • 7 Best Artificial Intelligence (AI) Software March 24, 2023
  • ESP32 Arduino Water Tank Level Monitoring Using Laser ToF Sensor March 23, 2023
  • Exploring the Benefits and Advantages of Microsoft’s Operating System March 22, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Fix : Hard Disk Full of MySQL Log Files, MySQL Failing to Start," in The Customize Windows, May 31, 2019, March 25, 2023, https://thecustomizewindows.com/2019/05/fix-hard-disk-full-of-mysql-log-files-mysql-failing-to-start/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT