Skip to content

Import json file to mysql database through command line

Notifications You must be signed in to change notification settings

WooodHead/import-json-mysql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Import json file through command line

Steps:

  1. Install node on the environment
  2. clone this repository https://github.com/devportolio/import-json-mysql.git
  3. Open the file import.js and edit this section based on your mysql credentials

const connection = mysql.createConnection({ host: "127.0.0.1", user: "root", password: "", database: "json_import" });

  1. Save the json file that you want to import inside the folder source
  2. Run this command to import the file

node import --table=mytablename --filename=file1.json

Note: You should be inside the folder that you cloned.

About

Import json file to mysql database through command line

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%