Share 3 cách để repair database

  • Thread starter Thread starter AdminAdmin is verified member.
  • Start date Start date
Admin

AdminAdmin is verified member.

Well-Known Member
Staff member
Administrator
1. you need to upload repair.php from your vB zip file to your /admin directory and run this url

yourdomain.com/admin/repair.php?html=1&check=1

2. or using mysqlcheck repair for 3.23.38 and above

i.e. in shell/telnet/ssh type while mysql is running and forum is CLOSED:

mysqlcheck -r -u mysqlusername -p databasename

3. or via myisamchk repair functions while mysql is shutdown/stopped in shell/telnet/ssh type :

myisamchk -r -u root -p tablename

option #3 most likely requires server and mysql root access to first stop mysql and then run myisamchk repair options.

***

More info on myisamchk from the man page:

Invoke myisamchk like this:

shell> myisamchk [options] tbl_name ...

The options specify what you want myisamchk to do. They are described in the following sections. You can also get a list of options by invoking myisamchk --help.

With no options, myisamchk simply checks your table as the default operation. To get more information or to tell myisamchk to take corrective action, specify options as described in the following discussion.

tbl_name is the database table you want to check or repair. If you run myisamchk somewhere other than in the database directory, you must specify the path to the database directory, because myisamchk has no
idea where the database is located. In fact, myisamchk does not actually care whether the files you are working on are located in a database directory. You can copy the files that correspond to a database
table into some other location and perform recovery operations on them there.

You can name several tables on the myisamchk command line if you wish. You can also specify a table by naming its index file (the file with the .MYI suffix). This allows you to specify all tables in a
directory by using the pattern *.MYI. For example, if you are in a database directory, you can check all the MyISAM tables in that directory like this:

shell> myisamchk *.MYI

If you are not in the database directory, you can check all the tables there by specifying the path to the directory:

shell> myisamchk /path/to/database_dir/*.MYI

You can even check all tables in all databases by specifying a wildcard with the path to the MySQL data directory:

shell> myisamchk /path/to/datadir/*/*.MYI

The recommended way to quickly check all MyISAM tables is:

shell> myisamchk --silent --fast /path/to/datadir/*/*.MYI

When using vBulletin 3:

Go right down to the bottom of the Admin CP to "Import & Maintenance", and select the option "Repair / Optimize Tables". Next, select the checkbox "Check All" or the specific table which is corrupt or damaged. At "Options" you may change the option for "Optimize Tables" to no, but this is an optional step. Now click the button "Continue", it should repair your damaged table(s).

Using PhpMyAdmin:

Go into PhpMyAdmin and type the following query in the SQL box:

REPAIR TABLE tablename

Source Vbulettin.com
 

Facebook Comments

Similar threads

Admin
Replies
0
Views
1K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
1K
AdminAdmin is verified member.
Admin
Back
Top