3

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
Dscoduc
  • 1,095
  • 2
  • 8
  • 15
  • Your problem might be relate to this bug: http://bugs.mysql.com/bug.php?id=28805 Try clearing your windows\temp directory, and setting up a specific temp folder for mysql in your my.ini – Pablius Jun 28 '13 at 21:35
  • The response of @Pablius did the job for me: - The service startup time was very long and it was impossible to connect - I had 1M+ files in c:\windows\temp Changing the parameter `tmpdir` (in `my.ini`) to a dedicated folder solved the problem. – NicolasF Aug 26 '15 at 14:27

1 Answers1

1

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.

Warner
  • 23,756
  • 2
  • 59
  • 69
  • Do you mean to say it might not be stopping cleanly? I added the log file info into the question... – Dscoduc Mar 23 '10 at 15:20
  • Provided the registry entry that starts the service (as it was installed by the MySQL installation process)... When I start it with the same syntax, but replacing the MySQL at the end with the --console syntax it starts right up... – Dscoduc Mar 23 '10 at 15:48
  • I switched to my Wordpress database, ran the 'show table status' syntax and it returned 12 rows in set... – Dscoduc Mar 23 '10 at 15:53
  • Could it be that my tables need to be optimized? I am looking for that syntax right now... – Dscoduc Mar 23 '10 at 15:59
  • See the update. – Warner Mar 23 '10 at 17:22