#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,670
    Rep Power
    171

    Server shut down during database rename process, now can't restart mysql server!


    Hello;

    Just experimenting "what" happens if "somethings goes wrong" in real world. I'm on localhost on a computer dedicated to testing! I was renaming the database (only 1 table with 10 million records) surprisingly takes a LONG time! In the middle I shut down xampp (of course the mysql server seperately).

    Now I cant restart it! I get:
    #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
    What do you think happened


    ===================
    Edit:
    Strange! After 30 minutes it poped up a window "MySql is shutting down"... And now it is working fine again!

    I wonder what happened!
    Last edited by zxcvbnm; April 30th, 2013 at 07:00 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    116
    Rep Power
    9
    It was database recovery...
  4. #3
  5. No Profile Picture
    Problem Solver
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2001
    Location
    Stockholm, Sweden
    Posts
    4,495
    Rep Power
    534
    My first question is why you choose to test the robustness of MySQL by _Renaming_a_Database_ and shut down MySQL in the middle?
    Renaming a Database is definitely one of these operations that are only performed once in a blue moon and the person performing it is 99% of the time the same DBA that performs the shutdown and usually he is not schizophrenic.

    My guess what happened is that your Renaming of database causes:
    1. Starts an implicit copy of all tables in the database, you only have one table but copying one table with 10,000,000 rows takes a while.
    2. You order shutdown, but since a software shutdown of MySQL means: -"Finish all tasks that you have ongoing, don't start on anything new and shutdown".
    3. MySQL will not accept any new connections while it is waiting to shut down.
    4. The Renaming operation is finally finished and the "MySQL shutting down" window pops up and MySQL shuts down.

    Either way if you want to test robustness I recommend that you do it with INSERT's, DELETE's and UPDATE's since that is what the database performs 99,99% of the time, not the occasional Data Definition Statements that a DBA is running.
    /Stefan
  6. #4
  7. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,670
    Rep Power
    171
    Originally Posted by sr
    schizophrenic.
    I agree with you it was just annoying the DB was called "testing" for past 3 weeks, I thought huh! A good chance to fix this and see what happens too. It was just something that happened. Lost a few tables too

IMN logo majestic logo threadwatch logo seochat tools logo