Jalankan perintah berikut:
mysql_update -u root -p
Hasilnya adalah:
root@DreamRunner:/home/pupil# mysql_upgrade -u root -p
Enter password:
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
This installation of MySQL is already upgraded to 5.5.40, use --force if you still need to run mysql_upgrade
Kemudian saya menambahkan option --force pada perintah sebelumnya, dan hasilnya adalah:
root@DreamRunner:/home/pupil# mysql_upgrade --force -u root -p
Enter password:
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock'
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock'
dbfiltering.f2225152
Error : Can't find file: 'f2225152' (errno: 2)
status : Operation failed
dbfiltering.f32193872
Error : Incorrect information in file: './dbfiltering/f32193872.frm'
error : Corrupt
--------------------------------------------------------------------------
--------------------------------------------------------------------------
dbfiltering.f33158600
Error : Can't find file: 'f33158600' (errno: 2)
status : Operation failed
dbfiltering.f33167568
Error : Incorrect information in file: './dbfiltering/f33167568.frm'
error : Corrupt
dbfiltering.f33167744
Error : Can't find file: 'f33167744' (errno: 2)
status : Operation failed
mysqlcheck: Got error: 2013: Lost connection to MySQL server during query when executing 'CHECK TABLE ... FOR UPGRADE'
FATAL ERROR: Upgrade failed
Seperti yang terlihat, ada beberapa error dalam struktur salah satu database. Kemudian saya masuk ke mysql dan menampilkan semua database yang ada:
mysql> show databases;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: *** NONE ***
+--------------------+
| Database |
+--------------------+
| information_schema |
| dbfiltering |
| mysql |
| performance_schema |
| phinter |
+--------------------+
5 rows in set (0.00 sec)
Setelah mengetahui bahwa database yang error adalah dbfiltering. Kemudian saya hapus database tersebut.
mysql> drop database dbfiltering;
ERROR 1010 (HY000): Error dropping database (can't rmdir './dbfiltering', errno: 39)
Karena gagal menghapus database dari dalam mysql, saya coba hapus database langsung dari dalam directory mysql yang terletak di /var/lib/mysql.
root@DreamRunner:/home/pupil# rm -r /var/lib/mysql/dbfiltering
Setelah itu saya ulangi lagi perintah mysql_upgrade
root@DreamRunner:/home/pupil# mysql_upgrade --force -u root -p
Enter password:
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock'
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock'
mysql.columns_priv OK
-----------------------------------------------------
-----------------------------------------------------
phinter.django_migrations OK
phinter.django_session OK
Running 'mysql_fix_privilege_tables'...
OK
Setelah melihat keterangan OK, saya coba jalankan lagi service mysql:
root@DreamRunner:/home/pupil# /etc/init.d/mysql restart
* Stopping MySQL database server mysqld [ OK ]
* Starting MySQL database server mysqld [ OK ]
* Checking for tables which need an upgrade, are corrupt or were
not closed cleanly.
Proses perbaikan selesai dan berhasil :)
Tweet
Tidak ada komentar:
Posting Komentar