Create a MySQL table from any CSV using Node.js script.
-
From a linux shell terminal install node and npm.
https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/ -
Clone repo and install the required packages.
git clone git@github.com:mortie23/csv-to-sql-js.git
npm init
npm install csvtojson@latest --save
npm install fs@latest --save
- Run the following command and the
inserts.sql
file should be generated.
./index.js data-classes.csv myschema