I am trying to setup sequelize
as ORM for my MariaDB
.
Here is my setup:
var sequelize = require('sequelize');
var db= new sequelize('dbname', 'user', 'pass', {
dialect: 'mariadb'
});
When I run my app I get the following error :
/my/path/to/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:23
throw new Error('Please install mysql package manually');
^
Error: Please install mysql package manually
Why is sequelize trying to connect to mysql rather than mariadb as I specified in the dialect
directive? Am I missing something?
Sequelize now has the dialect mariadb
, do not use mysql
npm install --save mariadb
npm install --save sequelize
Sequelize connection code...
var sequelize = new Sequelize('database', 'username', 'password', {
dialect: 'mariadb'
})
Sequelize internally uses the same library to connect with MariaDB or MySQL , take a look to the documentation http://docs.sequelizejs.com/en/latest/docs/getting-started/ specifically in the section Installation.
To make it works you just need to install mysql package so:
$ npm install --save mysql2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With