How to get mysql automatically running when I start tomcat apache on Windows?
You are going to love this.

Just install mysqld as a Windows Service. Ready ?

From the Windows DOS shell (ran as Administrator), go to the folder where mysqld.exe is located

Run this

mysqld --install


That's it. You can go to


ControlPanel
Administrative Tools
Service


When the Services Window opens, scroll alphabetically can you will see MySQL as a service

Restart Windows

When Windows comes back up, mysqld.exe should already be running.

Give it a Try !!!

See my other from ServerFault : (Feb 10, 2011 : Installing isolated instance of MySQL on Windows using silent install with .msi)