The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
How to Check, Recover & Repair MySQL Databases
Looks Familiar??? No matter how much you manage your sever, at one stage in your dealings with MySQL Databases you will get errors, So what do you do ?? Code:
jtablesession::Store Failed DB function failed with error number 145 Table './webkinzc_jo151/jos_session' is marked as crashed and should be repaired SQL=INSERT INTO `jos_session` ( `session_id`,`time`,`username`,`gid`,`guest`,`client_id` ) VALUES ( 'fd773853ae5aa0aca6aa7c22c79dcbbd','1230945305','','0','1','0' ) There can be different reasons why one wants to repair a MySQL database. Database corruption maybe due to a lack of disk space or an unexpected server shutdown that caused the database to go bad. Queries that worked before suddenly stopped working and overall the database is not behaving anymore as expected. This post is not a full database troubleshooting guide, but rather give you a hand on doing a MySQL repair on all databases on a cPanel/WHM server (or any other server running MySQL). The situation: Your server crashed hard and when it is back up the MySQL side of the house is not working anymore. You do your normal troubleshooting. If all other troubleshooting and verifications are done, you come to the conclusion that you will need to run a repair as the next step. A full database restore from a (hopefully existing) good database backup would be your last choice. Repairing one MySQL database is fairly easy, but how do you do this for an entire server holding20, 30, 50 or over 100 databases? You will need SSH access as the root user to the server running MySQL. So, log in as the root user and then do the following to repair your MySQL databases: Option #1 Check if you any need DB repair: Code:
myisamchk --check /var/lib/mysql/*/*.MYI Code:
myisamchk --safe-recover /var/lib/mysql/*/*.MYI Code:
myisamchk --recover /var/lib/mysql/*/*.MYI Code:
myisamchk --safe-recover --extend-check --force /var/lib/mysql/*/*.MYI Code:
myisamchk --recover --extend-check --force /var/lib/mysql/*/*.MYI Option #2 Use the mysqlcheck tool to repair your databases. Code:
mysqlcheck --all-databases -r #repair Code:
mysqlcheck --all-databases -a #analyze Code:
mysqlcheck --all-databases -o #optimize 1) Through cPanel: Log in to your cPanel and go to MySQL Databases. In the section Modify Databases, select a database from the drop-down box next to Repair DB: and then click the Repair DB button. If the database engine used by your database supports repair (for example, MyISAM supports it), you will see a list of the repaired tables within the database. If your database engine does not support repair (e.g. InnoDB database engine), you will get the following error message: note : The storage engine for the table doesn't support repair 2) Through phpMyAdmin: Open your phpMyAdmin tool and select the database whose tables you wish to repair. A list with all the database's tables will appear. Tick the tables you wish to repair, or simply click [Check All] to select all tables. Click the box [With selected:] and choose Repair table. This will execute the REPAIR TABLE SQL query on the selected tables and they will be repaired. There you have it. By using one of these threee options you should be able to repair and recover your databases. Please be advised that you should backup critical databases before running any of the commands above. If something goes wrong you can revert back and try again. In general the idea is to get people feeling confident enough to be able to work out a solution to a problem rather than worrying that they have a major serious issue. Hope that helps |
#2
|
||||
|
||||
Thanks for sharing...
what does the Quote:
|
#3
|
|||
|
|||
Thanks man, appreciate the advice.
|
#4
|
||||
|
||||
Good for solutions ...
Thanks !! |
#5
|
||||
|
||||
great work, thank you!
|
#6
|
|||
|
|||
I think it would be better placed here=> https://vborg.vbsupport.ru/forumdisplay.php?f=188 it's no vb article..
also pls see this: https://vborg.vbsupport.ru/showthread.php?t=210032 but no feedback |
#7
|
||||
|
||||
Thanks .Nice article .
|
#8
|
||||
|
||||
Thank you for advice
|
#9
|
||||
|
||||
if forum not running & data not Restore so....???
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|