Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As far as i understand my computer is experiencing a strange coincidence (hopefully it isn't and somebody can enlighten me).

Basically i shut down my laptop (Windows 7) (at 17.20, today, to be precise) successfully (and so also did XAMPP and its included components). However upon starting my laptop up again in the last hour i noticed that the MySQL module service in my xampp control panel was not coming on (just a big red tick; incidentally everything else was working fine). Now, i had the exact same problem about two weeks ago, whereby i just reinstalled xampp and got it working again. But rather than doing this straight away i thought i would just restart my laptop first. However it won't restart (or shut down first) to be precise now.

I can remember Windows wasn't shutting down properly the last time it happened (about two weeks ago). Just wondered if this coincidence pointed to any specific diagnostic as regards the problem with MYSQL? If so i would appreciate greatly any help. Otherwise sorry for wasting your time.

share|improve this question

1 Answer 1

MySQL is a database server intended to be run 24/7.

It's best if you use a program like MySQLAdmin to run a proper shutdown on MySQL before turning the computer off, otherwise MySQL has to run all it's InnoDB tables through a log-file rollback to a known good state on the next startup.

Uncontrolled shutdown is worse with MyISAM tables, they need to be flushed to disk before shutdown or major data corruption occurs, they're not transactional like InnoDB which attempts to do integrity checks if bad shutdown without flushing data to disk occurred.

The Operating System shutdown process should properly flush the MySQL tables, but I've been caught out just often enough on both WAMP and LAMP workstations, to know that every so often the shutdown gets forced before the tables complete being written out that I always manually control shutdown.

share|improve this answer
    
Thanks.If i uninstall mysql am i able to copy some of the data of my current database to my new installed version? Just copy mysql/data folder in the new installion? Or is that too good to be true... –  Roy Dec 16 '12 at 22:05
    
It's best if you use a program like MySQLAdmin to run a proper shutdown on MySQL before turning the computer off, otherwise MySQL has to run all it's InnoDB tables through a log-file rollback to a known good state on the next startup. Um, what? When you shut down, the MySQL service receives WM_QUERYENDSESSION via the service controller and should shut down as expected. It would only be a problem if you “shut down” by pulling the plug or pressing the reset button. –  Synetech Dec 17 '12 at 6:34
    
@Synetech Yes, you would think so, and mostly is true, except for the times when it didn't which caused grief. So, how do you ensure that WM_QUERYENDSESSION properly executes 100% of the time on shutdown to complete data flush to disk and the system doesn't decide to force shutdown anyway? I got tired of corrupted databases and the manual method ensures safe shutdown. –  Fiasco Labs Dec 17 '12 at 17:51
    
And as further notice, I've not had this problem on the MSSQL systems I have in the shop, just MySQL on both Windows and Linux. For some dumb reason, MySQL in my computer environment is suffering from problems processing OS triggered shutdowns via the standard controlled shutdown methods, intermittently, but enough to be really annoying. –  Fiasco Labs Dec 17 '12 at 18:16
    
Fair enough. At least MySQL has a proper/safe shutdown method (mysqladmin shutdown). When running Apache as a standalone process, the only way to shut it down seems to be to kill the process e.g., taskkill`) or to press Ctrl+C. `:-` –  Synetech Dec 17 '12 at 18:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.