After installing node.js and sequelize.js, and running a basic test, the message "You need to install mysql package manually" is displayed.
I've tried searching the web and Stackoverflow for the cause of this message.
I have installed:
Sequelize is a Node. js-based Object Relational Mapper that makes it easy to work with MySQL, MariaDB, SQLite, PostgreSQL databases, and more.
MySQL2 is the MySQL connector library used by Sequelize to connect to the MySQL db server. The DB wrapper uses mysql2 directly to connect to MySQL and create the database if it doesn't exist. For more info on MySQL2 see https://github.com/sidorares/node-mysql2.
Sequelize is an easy-to-use and promise-based Node. js ORM tool for Postgres, MySQL, MariaDB, SQLite, DB2, Microsoft SQL Server, and Snowflake. It features solid transaction support, relations, eager and lazy loading, read replication and more.
You need to install the mysql
npm module:
npm install mysql
The reason sequelize doesn't have the mysql module as its own dependency is because it can be used with other databases such as postgres or sqlite.
Install mysql globally:
npm install -g mysql
For 2017+ users who are using mysql2
, the mysql
requirement was part of Sequelize v3.
Install v4 of Sequelize (ie. npm i [email protected] --save
) and it will work properly with mysql2
.
For more info, see this issue in the github repo.
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