J
J
Jedi2017-10-14 23:04:38
MySQL
Jedi, 2017-10-14 23:04:38

What are the ways to connect to MySQL on Node JS?

Still using require('mysql') to connect to MySQL ?
As a PHP-shnik, I connected on puff using mysqli ...
What is the best option?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zlatoslav Desyatnikov, 2017-10-15
@PHPjedi

There are no standard tools in node for MySQL, you need to install them using npm.
The most popular and easiest option: https://github.com/mysqljs/mysql
A more interesting option (includes a migration system and query-builder) - https://github.com/tgriesser/knex
The second one also knows how to work with postgres and sqlite.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question