I wouldn't suggest automating the installation of a database along with the application. Very often the database is installed on a completely different server. Also the installation is centralized meaning that the same database will be used by many users so the database is typically installed only once whereas the application may installed several times.
Having that said, if you have your reasons to embed the installation to your application set-up, have a look at
https://dev.mysql.com/doc/refman/5.1/en/windows-installer-msi-quiet.html[
^]