It's easy, but it's a memorandum of commandment to me who often forgets to specify the DB and makes an application.
When doing rails new, specify the database and create an application. If you do not specify anything, the database defaults to sqlite, so do it when you want to use Mysql etc.
$rails new app name--database=mysql
There is also such a thing in a simplified writing style. Example
$rails new app name-d mysql
This is easier and nicer, -d means database.
I wrote it as a memorandum easily.