title: How to make sure a MySQL database exists before running Node.js app
body: <p>I have a Node.js/Express based app that is using Sequelize to talk to a MySQL server. What is the best way to ensure that a specific database exists before starting the app using <code>npm start</code>? I guess it would be some kind of one-time database initialization script that runs <code>CREATE DATABASE IF NOT EXISTS foo;</code> - I am just not sure where to put it and how to hook it up to a lifecycle event.</p>