• 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 , 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
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

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Join/Merge Multiple Log Files For Big Data Analysis

    Here Are The Ways To Join/Merge Multiple Log Files For Big Data Analysis, Store Them To OpenStack Based Cloud Storage And Delete Old Files.

  • Fix WordPress Error in Database Connection : MySQL Part

    MySQL Setup & Corrupted Database Has to Do With the Error Establishing a Database Connection. Fix WordPress Error in Database Connection.

  • Command Prompt Commands : Alphabetical list of all commands in Windows 7

    Command Prompt Commands in Windows 7 provides the user access to 180+ command line commands. Here is a list of 200 Command Prompt Commands in Windows 7.

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

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
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