Is there a way to have sequelize create the database I\'m trying to connect to if it doesn\'t exist?
I have a raw MySQL instance and I get this error back:
I ended up using the mysql2
package, here is what I did..
const mysql = require('mysql2/promise');
mysql.createConnection({
user : config.sequelize.username,
password : config.sequelize.password
}).then(() => {
connection.query('CREATE DATABASE IF NOT EXISTS myRandomDb;').then(() => {
// Safe to use sequelize now
})
})
After that I can connect to that database using sequelize
.