MySQL There are several common reasons for starting an error:
1 , the data area is full
2 , PID directory MySQL user does not have write permission
3 , the storage engine is the InnoDB engine, and this time it will need to restore all operations (Select,create,drop,insert). update,delete), MySQL boot error when unable to perform the recovery operation effectively
come to work in the morning, was informed the whole building to power outage, think about, the company room also put a few test machine, if suddenly power off, will lead to the test machine virtual machine is not available, hurriedly a set off the machine, which has a virtual machine is loaded with MySQL, Advanced go to turn MySQL off, avoid waiting for the boot MySQL error, and then turn off all the virtual machine, the last host
The final power off, after the call, hurriedly up the machine, all smooth, but when the MySQL
MySQL Start Error
# service MySQL startstarting mysql ..... ..... error! The server quit without updating PID file (/mydata/data/mysql. PID). Failed
I have a go, the most reluctant to see the thing or happened, step by step test it
1 , check disk condition
# df -h file system capacity used available%% mount point/dev/mapper/volgroup-lv_root 50g 11G 36G 24% /tmpfs 7.8g 0 7.8g 0% /dev/shm/dev/xvda1 485m 33m 427m 8% /boot/dev/mapper/volgroup-lv_ home 428g &Nbsp; 84g 323g 21% /home
There's a lot more disk space, excluding
2 , check if the PID file exists, and view the permissions for the directory in which it resides
# CAT/ETC/MY.CNF | grep pidpid-file =/home/data/log/mysql.pid
Go to the appropriate directory to view
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4D/B2/wKioL1RXVMWgCixUAATrePiqnFI716.jpg "title=" B98ed111-9844-4c4d-9feb-1f97151d31c2.png "alt=" Wkiol1rxvmwgcixuaatrepiqnfi716.jpg "/>
Well, there's permission, wait, what about my pid file? In other words, MySQL does not create a PID file at startup.
Create a test manually
Touch Mysql.pid
Change the genus Group
Chown Mysql.mysql Mysql.pid
Start again, also reported wrong.
Troubleshoot problems with the PID
3 , the configuration file can be, MySQL storage engine has InnoDB, may belong to the third case
Add the following parameters to the configuration file and start
Innodb_force_recovery = 4
Start OK
Note:
After successful startup, comment out this option in the configuration file and restart the database, otherwise, many operations will not support
Innodb_force_recovery The parameters have the following meanings
By default, 0 means that all recovery operations are performed when recovery is required
can be set to 1-6, when the parameter is greater than 0, the table can be slect,create,drop operation, but insert,update or delect this type of operation room is not allowed
1: Ignore Check to corrupt page 2: Prevent the main thread from running, such as the main thread needs to perform full purge operation, will cause crash 3: No transaction rollback operation 4: merge operation without insert buffering 5: Do not check the value of log, InnoDB storage engine will not Committed transactions considered committed 6: Do not roll forward operations
MySQL Startup error