I would like to use MySQL with Node.js on Windows. I have tried to use node-db-mysql, but it looks like it doesn't support Windows. Is there any other MySQL driver for Node.js that works on Windows?
Once you have MySQL up and running on your computer, you can access it by using Node.js. To access a MySQL database with Node.js, you need a MySQL driver.
JDBC, ODBC, and . Net drivers are necessary for MySQL as they enable the developers for building their database applications.
Quick Start: How to Use MySQL in Node Create a new project: mkdir mysql-test && cd mysql-test . Create a package. json file: npm init -y . Install the mysql module: npm install mysql .
You can use the Node. js OS module to do things like check the platform and return a platform-specific variable: Win32/. bat for Windows development, darwin/. sh for Mac/unix, Linux, SunOS, and so on (for example, var isWin = process.
I haven't used it, but https://github.com/felixge/node-mysql is at least pure javascript, so it should not have the same cross-platform concerns as the one you posted, which is a js wrapper around a c++ library.
node-mysql compatible mysql driver for node.js (node-mysql2), also works on Windows
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