tail -f /var/log/mysql/error.log したときに
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
な,エラーが出たときの対処法.
sudo nano /etc/mysql/my.cnf
[mysqld]
innodb_force_recovery = 3
を追記
sudo service mysql restart
ps aux | grep mysql
して,当該PIDをkillするsudo service mysql start
するmysqldump --events -u root -p -x --all-database > all-database.sql
mysqldump --events -u root -p -x --allow-keywords mysql > allow-keywords.sql
sudo mv /var/lib/mysql ~/mysql_datadir_backup
sudo mkdir /var/lib/mysql
sudo chown mysql:mysql /var/lib/mysql
sudo nano /etc/mysql/my.cnf して
[mysqld]
innodb_force_recovery = 3
を削除
mysql_install_db --datadir=/var/lib/mysql --user=mysql
sudo service mysql start
mysql -u root < all-database.sql
mysql -u root mysql < allow-keywords.sql
sudo service mysql restart
MySQLを起動し,動作確認が終了したら
sudo rm -rf ~/mysql_datadir_backup
して,退避した(壊れている)datadirを削除する