Bug #65
MySQL Fails to Start on Ubuntu at Boot Time
Description
An unknown incident caused MySQL to fail starting up at boot time. This wiped out all of the data from every table and corrupted the ibdata1
file. The engine used on this version of MySQL is InnoDB.
1. Check to see if the service is running:¶
sudo service mysql status
2. Attempt to start MySQL¶
sudo service mysql start
The service fails to start.
3. Backup the corrupt ib
files¶
sudo mkdir /var/lib/mysql/bak cp /var/lib/mysql/ib* /var/lib/mysql/bak
4. Start MySQL service with InnoDB recovery¶
mysqld --defaults-file=/etc/mysql/my.cnf --innodb-force-recovery=6
5. Dump the recovered MySQL databases to backup.sql
¶
mysqldump -u root -p --all-databases > backup.sql
6. Stop MySQL service with InnoDB recovery¶
ps -aux | grep mysql kill -s kill <PID#>
7. Purge the corrupt ib
files.¶
NOTE: Remember to backup the corrupt ib
files first. If something goes wrong with the working corrupt files, there will be nothing to fall back to.
sudo rm -rf /var/lib/mysql/ib*
8. Start the normal MySQL¶
sudo service mysql start
9. Import recovered databases from backup.sql
¶
sudo mysql -u root -p < backup.sql
Updated by Daniel Curtis over 11 years ago
- Assignee set to Daniel Curtis
- % Done changed from 0 to 100
I have still yet to find the cause of this database corruption. But I have managed to save the databases, and create backups of the databases. I should really look at setting up some sort of backup scheme on the Collaboration Server.