Windows – MySQL taking a long time to start

MySQLwindowsWordpress

I'm running Windows Server 2008 with MySQL installed and every time I reboot the server the MySQL Service doesn't start right away. A look into the Windows Eventlog shows that the MySQL Service was hung at startup. Looking at the Services.msc console shows the service state at Starting…

Eventually, like 10 minutes, the MySQL Service actually finishes the startup process and the database becomes available for my WordPress server…

I looked at the MySQL .err files and didn't find anything that would indicate a delay in the statup process…

Can anyone suggest a way to determine what is causing the delay, and more importantly, how to prevent the delay in the MySQL Startup?

UPDATE: Here is the .err log contents from the shutdown to the startup complete. Notice the startup begins at 10:30:00 and the MySQL isn't ready for connections until 10:47:14, a full 17 minutes later:

100322 10:27:06 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Normal shutdown

100322 10:27:06 [Note] Event Scheduler: Purging the queue. 0 events
100322 10:27:06  InnoDB: Starting shutdown...
100322 10:27:08  InnoDB: Shutdown completed; log sequence number 4 3854351346
100322 10:27:08 [Warning] Forcing shutdown of 1 plugins
100322 10:27:08 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Shutdown complete

100322 10:30:00 [Note] Plugin 'FEDERATED' is disabled.
100322 10:30:01  InnoDB: Started; log sequence number 4 3854351346
100322 10:47:14 [Note] Event Scheduler: Loaded 0 events
100322 10:47:14 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: ready for connections.

UPDATE 2: MySQL is configured as a service (part of the install process, nothing I did) and executes the following syntax (as it appears in the registry):

"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\my.ini" MySQL

Best Answer

Completely guessing: it sounds like it might not be stopping cleanly and thus going through an InnoDB recovery.

Provide the output 10 lines before restart to current from your MySQL log.

Edit 1

Thanks for the additional information. This looks like it might not be MySQL but Windows. What's specified in the service? Is there a script?

Edit 2

I misread previously. It looks like that there is a delay during InnoDB startup but it seems unusually long.

100322 10:30:01  InnoDB: Started; log sequence number 4 3854351346
100322 10:47:14 [Note] Event Scheduler: Loaded 0 events

Are you actually using InnoDB tablespace? show table status; within your DB will show the ENGINE. If not, I suspect disabling it will hasten startup time.

Edit 3

Wordpress doesn't appear use InnoDB by default. If you can verify none of your databases are InnoDB, adding skip-innodb to your my.ini will likely increase startup speed.

Related Topic