mysql crashing, no error in error log

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pedalpete
    New Member
    • Oct 2007
    • 109

    mysql crashing, no error in error log

    I've just recently started working with a new script and it runs without error on my local, but on my prod server, the sql crashes once every 50 or 75 times it runs.

    I checked the error logs, but it just shows me starting and stopping mysql, which I do because the table becomes unresponsive.
    I've tried running CHECK TABLE, but that hung as well.
    But then a restart and everything is fine.

    The table has just over 100,000 rows.
    here's the describe
    Code:
    +----------+--------------+------+-----+-------------------+-------+
    | Field    | Type         | Null | Key | Default           | Extra |
    +----------+--------------+------+-----+-------------------+-------+
    | id       | int(11)      | NO   | PRI |                   |       |
    | cid      | int(11)      | NO   |     |                   |       |
    | namefix  | varchar(255) | NO   | MUL |                   |       |
    | approved | tinyint(2)   | NO   | MUL |                   |       |
    | added    | timestamp    | NO   |     | CURRENT_TIMESTAMP |       |
    The queries are being passed via php, and the update query looks like this
    Code:
    UPDATE artistnamefix SET namefix='$newName', approved='2' WHERE id='$id'
    seems pretty straight forward to me, but there is definately something wrong somewhere.
    When it fails, no errors are being returned via php, the whole thing just hangs.

    The 'namefix' that I've seen fail don't have any special characters or anything either... very strange.

    Any suggestions as to how to further debug this?
    Last edited by Atli; Jan 6 '09, 11:40 PM. Reason: Added [code] to the table description.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    Seeing as this is working fine on you local server, I would assume this has something to do with your other server, rather than this being a problem with the SQL itself.

    Are there any major differences in the two servers?
    - Like different MySQL or PHP versions?
    Could it be that the your HDD or RAM is corrupted?
    - That the MySQL server is trying to use corrupt resources and locks up because of that?

    Do you use table locks or are you executing SQL queries in loops that may be running non-stop, or anything in that direction that may be causing MySQL to hang?

    P.S.
    Although this will probably not have any effect on this problem, you really shouldn't enclose numeric values in quotes in your SQL queries. Only string-like data should be quoted.

    Comment

    • pedalpete
      New Member
      • Oct 2007
      • 109

      #3
      Thanks Atli,
      I wasn't aware that you are not supposed to quote numerals in sql quiries, I'll change that.

      Turned out that this was due to an indexing issue.
      Didn't show up on test server because it is only working with a much smaller dataset (as is doesn't have the power of the prod server).

      Thanks for the help,
      Pete

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        Glad you found the problem.
        Always hard to debug stuff like this.

        Comment

        Working...