Every once in awhile I get email from my web site vBulletin that there is an error on MySQL. Below is the most recent error message. Looks like it might be caused by a hacker to me, what do you think? I've asked the technicians at iPage and they have no clue.

Database error in vBulletin 4.1.12:

Invalid SQL:

            SELECT text, languageid, special
            FROM phrase AS phrase
            LEFT JOIN phrasetype USING (fieldname)
            WHERE phrase.fieldname = 'error'
                AND varname = 'humanverify_image_wronganswer' AND languageid IN (-1, 0, 1);

MySQL Error   : MySQL server has gone away
Error Number  : 2006
Request Date  : Thursday, May 10th 2012 @ 03:11:52 AM
Error Date    : Thursday, May 10th 2012 @ 03:11:54 AM
Script        : <snipped>
Referrer      : <snipped>
IP Address    : 192.162.19.183
Username      : Steeseebups
Classname     : vB_Database
MySQL Version :
d

Another error message

Database error in vBulletin :

mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to MySQL server on 'stoberwebcom.ipagemysql.com' (4)
/hermes/bosweb/web243/b2436/ipg.stoberwebcom/forums/includes/class_core.php on line 317

MySQL Error   : 
Error Number  : 
Request Date  : Saturday, May 5th 2012 @ 12:41:27 PM
Error Date    : Saturday, May 5th 2012 @ 12:44:13 PM
Script        : <snipped>
Referrer      : 
IP Address    : 66.249.72.194
Username      : 
Classname     : vB_Database
MySQL Version : 

Dani AI

Generated

Short summary: the problem described above looks like intermittent MySQL connectivity/instability on a shared host rather than clear evidence of a targeted compromise. and are on the right track — shared servers can exhibit transient DB failures when load, networking, or daemon stability fluctuate. The most useful next step is to collect objective, time-stamped evidence you can hand to iPage so they can (a) reproduce the fault and (b) check the MySQL daemon and network around those times.

Quick, repeatable tests to run now (drop into webroot and run by cron every minute; adjust paths and creds):

<?php
$log = '/home/youracct/db_conn_log.txt';
$ts = date('c');
$start = microtime(true);
$link = @mysqli_connect('DB_HOST','DB_USER','DB_PASS','DB_NAME');
$elapsed = round(microtime(true) - $start, 4);
if (!$link) {
    file_put_contents($log, "$ts FAIL ({$elapsed}s): ".mysqli_connect_error().PHP_EOL, FILE_APPEND);
} else {
    mysqli_query($link, "SELECT 1");
    file_put_contents($log, "$ts OK ({$elapsed}s)".PHP_EOL, FILE_APPEND);
    mysqli_close($link);
}
?>

Also test from a shell (if available) and run traceroute/telnet to check network reachability:

mysql -h DB_HOST -u DB_USER -p -e "SELECT 1;"
traceroute DB_HOST    # or tracert on Windows
telnet DB_HOST 3306

What to request from the host when you escalate: MySQL error log entries for the reported timestamps, mysqld uptime and process restarts, server load and connection-count history, any throttling/connection-limit policies they enforce, and network outages affecting the MySQL node. Ask them whether they enforce limits (max_connections, per-hour query caps) and to search for "aborted connection" or crash messages in the server logs.

If the host cannot provide useful logs or the outages continue, consider moving to a VPS/managed DB or enabling aggressive caching (vBulletin caching / memcached) so the forum reduces DB hits. To rule out intrusion, check webserver access logs and vBulletin admin logs for abnormal spikes, failed-login activity, or unfamiliar admin accounts before assuming a hack.

Recommended Answers

All 3 Replies

Did you ran that query in your db ? If so, what does it return ?

This is a network connectivity problem. Might be that the mysql server on stoberwebcom.ipagemysql.com has to high load to response. That can happen on shared servers by other users and other applications than yours.

Do not expect a reasonable answer from the techicians at iPage... I've not gotten one yet from them.
I've been getting random MySQL outages as well... typically:
Lost connection to MySQL server at 'reading initial communication packet', system error: 110

The problem exists for 10-20 minutes (?) and then disappears as mysteriously as it first appeared.

Usually, the technicians review the problem 2-6hrs after I log it (and long after the issue has resolved itself)... they then promptly close the issue.

One technician tried to explain that they'd cut things off if there were too many queries within a one-hour span. However, I've gotten error messages when there have been no queries at all.

Sigh... I guess you get what you pay for.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.