When the disk is full, MySQL cannot be started: Diskisfullwriting & amp; # x27_MySQL

Source: Internet
Author: User
When the disk is full, MySQL cannot be started: Diskisfullwritingamp; amp; # x27;. mysql-bin .~ Rec ~ Amp; # x27; (Errcode: 28). Wa received a monitoring email saying that the blog access failed. Open the page and check that the huge 502 Bad Gateway, ping the VPS, and the SSH connection, and check the Nginx log, when lnmp is restarted, Mysql cannot be started, and the source of the problem is basically found.

Tail/usr/local/mysql/var/slyar. err

I checked the Mysql error log and encountered an unexpected situation ......

Disk is full writing './mysql-bin .~ Rec ~ '(Errcode: 28). Waiting for someone to free space... (please Ct up to 60 secs delay for server to continue after freeing disk space)

The magic is that Mysql cannot be started because the disk is full and logs cannot be written.

Root @ slyar #

Df

Filesystem 1K-blocks Used Available Use % Mounted on

/Dev/sda1 3016688 2877540 0 100%/

Sure enough, the/var directory burst.

Root @ slyar:/usr/local/mysql/var # ll -- block-size = MB

All 504 MB

-Rw ---- 1 mysql 26 MB Jul 23 2012 mysql-bin.000011

-Rw ---- 1 mysql 5 MB Jul 26 2012 mysql-bin.000012

-Rw ---- 1 mysql 27 MB Aug 8 2012 mysql-bin.000013

-Rw ---- 1 mysql 43 MB Aug 23 2012 mysql-bin.000014

-Rw ---- 1 mysql 270 MB Feb 9 mysql-bin.000020

-Rw ---- 1 mysql 115 MB Apr 19 mysql-bin.000021

-Rw ---- 1 mysql 1 MB Feb 10 12: 07 mysql-bin.index

-Rw ---- 1 mysql 0 MB Apr 19 12:34 mysql-bin .~ Rec ~

Basically, these things are full. I checked the Mysql manual and found that these things are useless and deleted directly (this operation is best performed when the Mysql service is stopped, if the current log is used, it cannot be deleted and may cause some other problems. However, you can use the mysql> reset master Command to directly clear the log ).

Root @ slyar:/usr/local/mysql/var # rm-f./mysql-bin .*

To prevent this situation from happening again, directly disable the log-bin function of Mysql.

Vim/etc/my. cnf

Find:

Log-bin = mysql-binbinlog_format = mixed

Add # Comment out before: wq save and exit.

Finally:

/Etc/init. d/mysql restart

Start the Mysql service. everything is normal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.