Home > Other Systems (CPVLab, iMobiTrax, P202, Track Revenue, Click, Google Analytics, etc.) > Normal Prosper202

Prosper Error? (11)


12-15-2011 08:41 PM #1 mgrunin (Member)
Prosper Error?

I just noticed that my Prosper domain has been giving of errors for the last few hours. When going through my redirects, I get this error:

Fatal error: Call to undefined function record_mysql_error() in /home/maserati/public_html/tracking202/redirect/dl.php on line 244

On my Spy Page, I get this error:

Table './maserati_this/202_clicks_spy' is marked as crashed and should be repaired

SELECT * FROM 202_clicks_spy AS 2c LEFT JOIN 202_clicks_advance AS 2ca USING (click_id) LEFT JOIN 202_clicks_site AS 2cs USING (click_id) LEFT JOIN 202_aff_campaigns AS 2ac ON (2c.aff_campaign_id = 2ac.aff_campaign_id) LEFT JOIN 202_aff_networks AS 2an ON (2ac.aff_network_id = 2an.aff_network_id) WHERE 2c.user_id='1' AND click_filtered='0' AND 2an.aff_network_id='1' ORDER BY 2c.click_id DESC

What the hell happened?


12-15-2011 08:50 PM #2 bbrock32 (Administrator)

Run these commands from the terminal and you will be good to go.

mysqlcheck -r --all-databases
mysqlcheck -f --all-databases
mysqlcheck -o --all-databases


12-18-2011 02:36 AM #3 BeyondHosting-Tyler (Member)

Means something got restarted incorrectly or mysql ran out of resources.

Could be an open files limit issue to.

Like Besmir said, run: mysqlcheck --all-databases -B -e --auto-repair --optimize


12-18-2011 02:58 AM #4 mgrunin (Member)

bbrock32 helped me out by suggesting I click on "Repair DB" in my cpanel. Worked perfectly.


12-18-2011 08:35 PM #5 lixor (Member)

when i had a big site on a shared server this happened to me every day and from what i see i used the following script to automatically check and fix the errors:

checkmysqltables.php
[PHP]
/*
* Script to check the validity of MYSQL tables by running CHECK TABLE
* on every table in the given database.
*
* To use:
* php -f <path_to_script> [-- options]
*
* (need to use "--" to separate script options from PHP options
*
* Example:
* php -f /usr/local/bin/checkmysqltables.php -- -verbose -fast
*
* An example cron entry, checks each day at 2:02am:
* 2 2 * * * /bin/php -f /bin/checkmysqltables.php
*
*/
$usage = "Checks the validity of tables in a mysql database\n\n" .
"Usage: " . $argv[0] . " [options]\n" .
" -f[ast] perform a fast check (CHECK TABLE tblName FAST)\n" .
" -<?|h|x> show usage string (this message)\n" .
" -v[erbose] display verbose messages while running\n";

$msg = "";
$fast = false;
$verbose = false;
$server = "localhost";
$database = "";
$uid = "";
$pwd = "";
$tcount = 0;

array_shift($argv); // take out the script name

foreach ($argv as $option) {
switch ($option) {
case '-f':
case '-fast':
$fast = true;
break;
case '-v':
case '-verbose':
$verbose = true;
echo "Verbose enabled\n";
break;
case '-x':
case '-?':
case '-h':
die($usage);
break;
default:
die("Unknown parameter: " . $option . "\n\n" . $usage);
break;
}
}

if ( ! mysql_connect($server, $uid, $pwd) ) {
die("Failed connecting to server: " . mysql_error());
}

if ($verbose) echo "Connected to server: $server\n";

if ( ! mysql_select_db($database) ) {
die( "Failed selecting database '$database': " . mysql_error() );
}

if ($verbose) echo "Selected database: " . $database . "\n";

$rs_tables = mysql_query("SHOW TABLES");

if (!$rs_tables || (($num_tables = mysql_num_rows($rs_tables)) <= 0) ) {
die( "Could not iterate database tables\n" );
}
if ($verbose) echo "Number of tables: $num_tables\n";

$bOk = true;
$checktype = "";

if ($fast) $checktype = "FAST";

while (list($tname) = mysql_fetch_row($rs_tables)) {
$query = "CHECK TABLE `$tname` $checktype";
if ($verbose) printf("%3d. $query:\n", ++$tcount);

$rs_status = mysql_query( $query );
if (!$rs_status || mysql_num_rows($rs_status) <= 0 ) {
$msg .= "Could not get status for table $tname\n";
$bOk = false;
continue;
}

// seek to last row
mysql_data_seek($rs_status, mysql_num_rows($rs_status)-1);
$row_status = mysql_fetch_assoc($rs_status);
if ($row_status['Msg_type'] != "status") {
$msg .= "Table {$row_status['Table']}: ";
$msg .= "{$row_status['Msg_type']} = {$row_status['Msg_text']}\n";
$bOk = false;

$tablename = $row_status['Table'];
$row_repair_table = @mysql_query("REPAIR TABLE `$tablename`");

if ($verbose) echo " ** Check failed!!\n";
}
if ($verbose) {
echo " {$row_status['Msg_type']} -> {$row_status['Msg_text']}\n";
}

}

if ( ! $bOk ) die( "Check failed: \n\n" . $msg );

exit(0);[/PHP]

just put your database name, user and password in:
$database = "";
$uid = "";
$pwd = "";

and set it as a cron


12-18-2011 11:02 PM #6 sm1810 (Member)

^ x2 check the code it's not working. I think it's the stuff you commented out..


12-19-2011 06:02 PM #7 lixor (Member)

the code was intented to work as a cron, if you just want to test it in your browser address you must add:

$argv[0] = "-f";
$argv[1] = "-v";

above the $msg = "";

and it should work


12-19-2011 06:07 PM #8 sm1810 (Member)

I copied the code in a file and using this cron command

php -f /www/checkmysqltables.php

keep getting No input file specified.


12-19-2011 08:51 PM #9 lixor (Member)

you can try with

/usr/bin/php -f /www/checkmysqltables.php

or

if you don't know the correct path to your checkmysqltables.php file make a new php file, test.php with the following:

<?php
echo $_SERVER['DOCUMENT_ROOT'];
?>

upload it in the same directory with the checkmysqltable.php file, run it and see which is the correct path, it will be something like: /home/xxx/public_html/...

and then try with /usr/bin/php -f /home/.../checkmysqltables.php

it should work


12-20-2011 03:03 AM #10 sm1810 (Member)

i think it's still not working right now I get this...(i've hidden the values of DBNAME, DBUSER, PASS)

$msg = "";<br>
$fast = false;<br>
$verbose = false;<br>
$server = "localhost";<br>
$database = "DBNAME";<br>
$uid = "DBUSER";<br>
$pwd = "PASS";<br>
$tcount = 0;


12-20-2011 03:27 PM #11 lixor (Member)

it works for me, tested with prosper, when i run it i get:

Verbose enabled Connected to server: localhost Selected database: [my db, edited] Number of tables: 61 1. CHECK TABLE `202_aff_campaigns` : status -> OK 2. CHECK TABLE `202_aff_networks` : status -> OK 3. CHECK TABLE `202_alerts` : status -> OK 4. CHECK TABLE `202_browsers` : status -> OK 5. CHECK TABLE `202_charts` : status -> OK 6. CHECK TABLE `202_clicks` : status -> OK........

i uploaded it now on http://www.2shared.com/file/fUZ-BeOg...sqltables.html


Home > Other Systems (CPVLab, iMobiTrax, P202, Track Revenue, Click, Google Analytics, etc.) > Normal Prosper202