April 30th, 2013, 07:52 AM
Server shut down during database rename process, now can't restart mysql server!
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:
What do you think happened
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 08:00 AM.
April 30th, 2013, 08:49 AM
It was database recovery...
April 30th, 2013, 09:50 AM
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.
April 30th, 2013, 08:05 PM
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