| NANO | 2007-02-06 07:35:00 |
![]() Posts: 158 Topics participated: 79 Topics started: 18 First post: 2006-03-10 22:20:00 Last post: 2007-11-24 19:37:00 |
Hi guys, i recently changed my tracker to a new server and im getting some errors in the db like 3 times per day... i run a repair from phpmyadmin and all fine again... the errors in the db as is shown in the tracker are in the torrents table and the news table... weird. Well i got this php for repair: php require_once("include/secrets.php"); $db = mysql_connect($mysql_host, $mysql_user, $mysql_pass); $sql = "SHOW DATABASES"; $dbs_result = mysql_query($sql, $db); if(mysql_num_rows($dbs_result)) { while($dbs_row=mysql_fetch_assoc($dbs_result)) { $database = $dbs_row["Database"]; echo "\n\nOptimizando y Reparando la base de datos: \n"; mysql_select_db($database, $db); $sql = "SHOW TABLE STATUS"; $tbls_result = mysql_query($sql, $db); if(mysql_num_rows($tbls_result)) { while($tbls_row=mysql_fetch_assoc($tbls_result)) { $TableName = "`".$tbls_row["Name"]."`"; $sql = "REPAIR TABLE ".$TableName; echo "\n".$sql; mysql_query($sql, $db); $sql = "OPTIMIZE TABLE ".$TableName; echo "\n".$sql; mysql_query($sql, $db); } } } } echo "\n\n"; mysql_close($db); ?> But when i use this i get a error again... Table './tracker/torrents' is marked as crashed and last (automatic?) repair failed Can anyone help me giving me a simple php for repair the entire database and not need to login in phpmyadmin etc....... and with this any user of my staff could solve the problem if im not online. Thanks guys! PD: i use DR source. |
![]() |
help with php for repair database
| Falken | 2007-02-06 21:10:00 |
![]() Posts: 137 Topics participated: 74 Topics started: 24 First post: 2006-10-12 20:44:00 Last post: 2009-01-01 16:14:00 |
think this one will help u?! it works for me:) hehe sorry m8 don't know how i can miss ur code but this one works for me.. |
![]() |
| NANO | 2007-02-06 21:21:00 |
![]() Posts: 158 Topics participated: 79 Topics started: 18 First post: 2006-03-10 22:20:00 Last post: 2007-11-24 19:37:00 |
did you read me post? :D that is what i posted... and it dont works in my tracker :( |
![]() |
| blanconero | 2007-02-06 21:29:00 |
![]() Posts: 373 Topics participated: 97 Topics started: 5 First post: 2006-12-08 14:16:00 Last post: 2008-08-25 19:10:00 |
Table './tracker/torrents' is marked as crashed and last (automatic?) repair failed This table is an innodb table? |
![]() |
| NANO | 2007-02-06 22:07:00 |
![]() Posts: 158 Topics participated: 79 Topics started: 18 First post: 2006-03-10 22:20:00 Last post: 2007-11-24 19:37:00 |
no, type MyISAM |
![]() |
| blanconero | 2007-02-06 22:11:00 |
![]() Posts: 373 Topics participated: 97 Topics started: 5 First post: 2006-12-08 14:16:00 Last post: 2008-08-25 19:10:00 |
try just a repair thing mysql_query("REPAIR TABLE torrents"); |
![]() |
| NANO | 2007-02-07 07:25:00 |
![]() Posts: 158 Topics participated: 79 Topics started: 18 First post: 2006-03-10 22:20:00 Last post: 2007-11-24 19:37:00 |
just that in a php... will try it. Thanks bro! php require_once("include/secrets.php"); $db = mysql_connect($mysql_host, $mysql_user, $mysql_pass); mysql_query("REPAIR TABLE torrents"); ?> is allright? btw, what if i want to repair the entire db and not only torrents table? any idea? |
![]() |
Similar threads
| Topic | Posts | Last post |
|---|---|---|
| Optimize & Repair Database from Tracker | 2 | 2008-03-06 12:27:00 |
| Auto Repair Database with Cron jobs | 4 | 2008-08-21 13:19:00 |
| Need help with database or php! | 14 | 2008-11-30 13:52:00 |
| Simple ORM database mapping for PHP | 1 | 2008-09-18 06:48:00 |
| How can i repair this problem? | 8 | 2008-05-22 17:30:00 |
Statistics
| Today's active topics · | |
|---|---|
| User(s) active in the past 30 minutes | |
| 40 Guests, 12 Members 1337, The Black Notes, pumpin-servers, keii, MiDGET, ozziiee, nickelz34, jozy, cTL, Deags, hitmewithmuzak, RazorSA Posadzki żywiczne , Posadzki polimerowe , teczki , cool water davidoff , Finanse Tanie kredyty refinansowe online bingo Najlepsze konta bankowe Lokaty Leasing finansowy | |
| Often viewed topics | |
| · Warned users (o... · torrent uppload... · Question about ... · new Message · Invite With Bonus · ballon tooltip · Browse.php · Preliminary XSS... · RSS feed passke... · Save PMs to temp! · Rating using ajax · action script · Torrent Inline ... · Similar torrent... · Ratio Master · Nice signup usi... · New BBCode · Pre-time withou... · last 10 forum ... · Null Announce. | |
| Forthcoming Calendar Events within the next 5 days | |
| There are no forthcoming calendar events | |



