Page 1 of 1

Proper way to shutdown MySql

PostPosted: 25. November 2013 22:54
by russdirks
What is the proper way to shutdown MySql? I'm not running it as a service, so I used the Start/Stop buttons in the Xampp CP 3.2.1, but I noticed the following error message in the MySql log the next time I started :

Code: Select all
131125 13:18:06  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...


I read somewhere (can't find it now, though) that xampp just kills the mysql process, rather than using mysqladmin to do a proper shutdown. Is that true? I guess I need some reassurance that the Stop button in the control panel is not going to cause me problems.

Re: Proper way to shutdown MySql

PostPosted: 26. November 2013 00:20
by JJ_Tagy
From cmd prompt: "mysqladmin shutdown -uroot -p"

It will show as error in control panel, but you can ignore.

Re: Proper way to shutdown MySql

PostPosted: 26. November 2013 00:43
by russdirks
So I guess you're confirming that using the Stop button in the control panel is not a good way to shut down MySql?

I'm puzzled why xampp uses that method if it causes problems!

Re: Proper way to shutdown MySql

PostPosted: 26. November 2013 01:20
by JJ_Tagy
I wouldn't say it isn't the way, but to properly send MySQL through a proper shutdown sequence it is a better method. The control panel uses the kill method. I think only recently did it start causing problems.

Re: Proper way to shutdown MySql

PostPosted: 26. November 2013 05:42
by Altrea
The default way of stopping the mysql single component is creating issues for all XAMPP 1.8.3-X versions (so all versions including MySQL 5.6.X).

Why XAMPP is using this way is very easy: the recommend shutdown command needs a database permission with SHUTDOWN privileges. This username/password combination could, should and needs to be changeable by the user because of security reasons but:
- we would need to save that password anywhere in the control panel (we don't want that)
or
-the user needs to enter the defined username/password for any shutdown (we don't want that either).

There is an alternative a user can use:
Starting/stopping mysql as windows service uses different commands which (maybe) don't produce such issues.