• 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 space full fix , mysql housekeeping logs on windows , mysql purge binary logs after 4 hours , sql binary log housekeeping

This Article Has Been Shared 337 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic 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

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

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 (20K Followers)
  • Twitter (4.9k Followers)
  • Facebook (5.8k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.2k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Wi-Fi for Old House With Thick Walls January 26, 2021
  • What is Inertial Navigation System? January 25, 2021
  • What is Miniaturization? January 24, 2021
  • What is Domain-Driven Design (DDD)? January 23, 2021
  • Top 10 Anti Hacking Software for Microsoft Windows January 22, 2021

 

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, January 26, 2021, https://thecustomizewindows.com/2019/05/fix-hard-disk-full-of-mysql-log-files-mysql-failing-to-start/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

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

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

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