MySQL Startup error and Repair

Source: Internet
Author: User
Tags mysql command line

Tried to back up the database yesterday, but did not succeed, the cause of the error is #got errno on write

This is because there is not enough disk space or the Max_allowed_packet variable is set too small in MySQL settings

Use #set Global max_allowed_packet = 2*1024*1024*10 in the MySQL command line. Set it to 20M

and restart the MySQL command line, back up again, find the same error, suspect that disk space is full, after viewing,

[Email protected] bin]# df-h
Filesystem Size used Avail use% mounted on
/DEV/XVDA1 20G 20G 412M 98%/
Tmpfs 498M 0 498M 0%/dev/shm
/DEV/XVDB1 69G 17G 49G 26%/Home

The first disk was found to be full, but it was not known that the items were placed on the first disk, so a bunch of unknown databases in the WWW directory were deleted.

After deletion to make a backup discovery or appear #got errno on write, unknown so .....

At this time landing site found unsuccessful landing, the error reason for table ' * * * * is marked as crashed and should be repaired.

Restart the server, re-open nginx, MySQL, PHP, no, when you open the MySQL error, prompted that the error has been written into the log.

The error log location to find MySQL is:/var/log/mysqld.log. Open the view and find the following error

150211 13:49:01 [ERROR]/usr/local/mysql/bin/mysqld:table './erqilu_87/pw_log_userdefend ' is marked as crashed and Shoul D be repaired
150211 13:51:21 [ERROR]/usr/local/mysql/bin/mysqld:table './erqilu_87/pw_log_userdefend ' is marked as crashed and Shoul D be repaired
150211 13:52:02 [ERROR]/usr/local/mysql/bin/mysqld:table './erqilu_87/pw_log_userdefend ' is marked as crashed and Shoul D be repaired

There are many reasons to find the error:

1. It is possible to update queries frequently dede_archives

2. The database is damaged for some reason

The following repair methods are as follows
Find the MySQL installation directory of the Bin/myisamchk (this is:/usr/local/mysql/bin) tool, here is the command line input:

Myisamchk-c-r/Directory name/table name. MYI

Here is: Myisamchk-c-r/var/lib/mysql/erqilu_87/pw_log_userdefend. MYI


Then the Myisamchk tool will help you recover the index of the data table. Without restarting MySQL, the problem is solved.

The 27-way website can be accessed and logged in normally.

There are several other methods of repair, even myi files can be repaired after the loss, not to repeat.

Summary of problem repair methods that occur

1. View the log first

2. How to solve online search problems according to the log

3. Try to fix

February 11, 2015 14:47:41

The method of backing up and recovering the database is written out in practice.

MySQL Startup error and Repair

Related Article

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.