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