MilesWeb
MilesWeb Hosting Forum

Please login or register.

Login with username, password and session length

 

News:

SMF - Just Installed!


Author Topic: MYsql - How to check mysql database and how to repair it ?  (Read 4007 times)

0 Members and 1 Guest are viewing this topic.

Offline Dipak Bhoi

  • MilesWeb Team Member
  • Full Member
  • ***
  • Posts: 208
  • Karma: +5/-0
    • View Profile
    • MilesWeb Internet Services
MYsql - How to check mysql database and how to repair it ?
« on: January 11, 2014, 11:29:54 PM »
Hello,

I am new for linux hosting and want to know how to check MySQL database and how to repair it, if there is a problem in database.

If you have a same question in your mind then you are on correct forum. Below are the command which help you to check database and also repair it. Login into your server via ssh as a root user and performed following things.

To check the database run the command as below.

Quote
# mysqlcheck database_name

databse_name.table_name                          OK
databse_name.table_name                          OK
databse_name.table_name                          OK
databse_name.table_name                          OK
databse_name.table_name                          OK
databse_name.table_name                          OK
databse_name.table_name                          OK
databse_name.table_name                          OK

If you receive the output as above then there is everything is well in your database. If you get the output as below.

Quote
databse_name.table_name                          OK
databse_name.table_name                          OK
databse_name.table_name                          OK
databse_name.table_name                          OK
databse_name.databse_name
warning  : Table is marked as crashed
Above output is showing there is a table which has been crashed, you will have to repair it by running following given command.

Quote
#myisamchk -r -f databse_name/databse_name.MYI

Quote
Data records: 346
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
- Fixing index 5
- Fixing index 6

This command will fix the corrupt table, once they are repaired you can re-check your database by running mysqlcheck command.
« Last Edit: January 12, 2014, 07:42:06 PM by Administrator »
MilesWeb.com
cPanel Hosting in India - cPanel Hosting in India.

Grab an SSL for your website and SAVE 20% now. Coupon Code SSLSAVE20.

MilesWeb Hosting Forum

MYsql - How to check mysql database and how to repair it ?
« on: January 11, 2014, 11:29:54 PM »