In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article focuses on "what methods can be used to repair mysql tables". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the ways to fix the mysql table"?
The first way to repair the mysql table is:
Shell > mysqlcheck-r-c-o-uuser-ppasswddb_name
The second way to fix the mysql table, using the following script, offline from the Internet, seems to be very useful. Place the script in your web root directory and run the script from the web page.
What are the ways to repair the mysql table
Catrepair.php needs to modify $dbuser= "root";-> need to modify $dbpw= "";-- > need to modify $dbname= "db_name";-- > need to modify # $table= "search_profile"; mysql_connect ($dbhost,$dbuser,$dbpw); mysql_select_db ($dbname); if (! get_cfg_var ("register_globals")) {foreach ($HTTP_GET_VARSas$key= > $val) {$key=$val;}} functionchecktable ($table,$loops=0) {global$db,$nohtml;$result=mysql_query ("CHECKTABLE$table") If (! $nohtml) {echo "Checkingtable$table"; echo "TableOperationTypeText";} else {echo "\ n > CheckingTable$table\ n"; echo "-\ n";} $error=0;while ($r=mysql_fetch_row ($result)) {if ($r [2] = = 'error') {if ($r [3] = = "Thehandlerforthetabledoesn'tsupportcheck/repair") {$r [2] =' status';$r [3] = 'Thistabledoesnotsupportcheck/repair/optimize' Unset ($bgcolor); $nooptimize=1;} else {$error=1;$bgcolor='red';unset ($nooptimize);}} else {unset ($bgcolor); unset ($nooptimize);} if (! $nohtml) {echo "$r [0] $r [1] $r [2] $r [3]";} else {echo "$r [0] | $r [1] | $r [2] | $r [3]\ n";} if ($error) {if (! $nohtml) {echo "Repairingtable$table";} else {echo "> RepairingTable$table\ n";} $result2=mysql_query ("REPAIRTABLE$table") If ($result2 [3]! = 'OK') $bgcolor='red';elseunset ($bgcolor); if (! $nohtml) {echo "$result2 [0] $result2 [1] $result2 [2] $result2 [3]";} else {echo "$result2 [0] | $result [1] | $result2 [2] | $result2 [3]\ n";} if (($result2 [3] = =' OK' |! $error) &! $nooptimize) {if (! $nohtml) {echo "Optimizingtable$table";} else {echo "> OptimizingTable$table\ n";} $result3=mysql_query ("OPTIMIZETABLE$table"); $error=0 While ($r3=mysql_fetch_row ($result3)) {if ($R3 [2] = = 'error') {$error=1;$bgcolor='red';} else {unset ($bgcolor);} if (! $nohtml) {echo "$R3 [0] $R3 [1] $R3 [2] $R3 [3]";} else {echo "$R3 [0] | $R3 [1] | $R3 [2] | $R3 [3]\ n";}} if ($error&&$loops) {checktable ($table, ($loops-1));} if ($check) {$tables=mysql_query (SHOWTABLES ") If (! $nohtml) {echo ";} if ($iterations) {$iterations--;} while ($table=mysql_fetch_row ($tables)) {if (substr ($table [0],-8)! = 'sessions') {$answer=checktable ($table [0], $iterations); if (! $nohtml) {echo";} flush ();} if (! $nohtml) {echo "" }} else {echo "DatabaseTableRepairUtilityforDiscuz! (RequireMySQL3.23)". "Thisscriptwillattempttorepaircorrupteddatabases.Whileitcanrepairmostcommonerrors,". "itcannotrepaireverything.Asasidebenefititwillalsooptimizeyourtables.". "Usage:". "nohtml=1 (xisthenumberoftimesyouwishforthescripttoattempttorepairabrokentable)". "nohtml=1 (withoutthisyouwillgetthisscreenandnochecking)". "ExampleUsage:". "repair.phphtml=1&check=1 (mostcommonusage,willcheckaforumandreturnhtmlresults)". "repair.phpcheck=1&iterations=5 (trytorepairdamagedtables5times)".
At this point, I believe you have a deeper understanding of "what methods can be used to repair the mysql table". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.