Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8044631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:17:22+00:00 2026-06-05T05:17:22+00:00

On my virtual dedicated linux server, there are always some php jobs running. These

  • 0

On my virtual dedicated linux server, there are always some php jobs running. These jobs keep writing data in different tables. I was wondering, what happens if i need to restart my mysql server as i have made some config changes? Will all the running jobs be killed if i restart my mysql server ? or will they be on hold for a while , throwing error while the server is being restarted?

Thanks for your help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:17:24+00:00Added an answer on June 5, 2026 at 5:17 am

    If you put a bit of code around the actual mysql php calls, you can catch the errors and deal with them.

    function mquery( $qry, $lnk ) {
    global $dbl;  # your pre-established database link
    
    $result = mysql_query( $qry, $lnk );
    
    if ( $result === false ) {
        $error_msg = mysql_error( $lnk );
    
        while ( $result === false && @$i < 25 ) {
            $i++;
    
            $error_no  = mysql_errno( $lnk );
    
            if      ( $error_no == 1054 ||  # "MySQL Error #1054: Unknown column..."
                         $error_no == 1064 ||  # "You have an error in your SQL syntax" - MAC - May 30, 2012
                         $error_no == 1065 ) { # "Query was empty" 
                break;  # don't loop on errors - it will not succeed
            }
            else if ( $error_no == 1205 ||  # SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction
                         $error_no == 1213 ) { # "Deadlock found when trying to get lock; try restarting transaction" 
                sleep( $i );                 # try sleeping a bit longer to get past the deadlock
            }
            else if ( $error_no == 2003 ||  # SQLSTATE[HY000] [2003] Can't connect to MySQL server
                         $error_no == 2006 ||  # "MySQL server has gone away" -- reconnect 
                         $error_no == 2013 ) { # SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading authorization packet', system error: 0
                sleep( $i );
                if      ( $lnk == $dbl )    { # you may have multiple database links...
                    get_dbl();   # re-establish your database link
                    $lnk = $dbl;
                }
            }
            else {
                sleep( 1 ); # keeps us from sleeping too long on other errors
            }
    
            $result = mysql_query( $qry, $lnk );
        }
        echo "\n<!-- MySQL Error #$error_no: '$error_msg' (tried $i times) -->\n";
    }
    
    return $result;
    

    }
    // end mquery

    If you find that you have other errors that may succeed if you wait a little while, then add them.

    For errors that won’t succeed no matter how long you wait, add them to the ‘break’ block of code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a virtual dedicated server (running FreeBSD 6.x) and I need to regulary
i am using virtual dedicated server and the configuration is windows server 2008 R2
We are planning to take a virtual dedicated server where we can host our
I'm trying to install FFMPEG on a virtual dedicated server with Red Hat Fedora
I currently have a virtual dedicated server through Media Temple that I use to
Error while running an installed Windows Service on dedicated Server I installed my windows
I have a dedicated CentOS server. I manage all my users, apps, and virtual
virtual() can be used only when running PHP as an apache module. My shared
I have a Virtual Dedicated Server, how can I run an application periodically (ie:
I've just become a proud owner of a MediaTemple virtual-dedicated server. My question is:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.