Create the my.cnf file before mysql-server install

The my.cnf file is used by the mysql-server package do perform some
initial steps one of them includes setting the innodb log file size.
If the log file size is changed after mysql initially set up the log
files, it will fail to start. Putting this file before the package
installation will allow to set the correct size for the log file
during initial setup.
Add mysql-common to the debian package list

The mysql-common package installs the my.cnf file for MySQL. It is
required that we install this package before installing the my.cnf
file with the template because when this package gets installed,
if it sees a my.cnf pre-existing, it will prompt for options to
either keep the package maintainer version or the user installed
version. Installing this prior to creating the my.cnf file works.