Querying MySQL from NodeJS Tutorial/Example




This is a video tutorial on how to connect to, select data from, and insert data into a MySQL database through NodeJS.

Original source


3 responses to “Querying MySQL from NodeJS Tutorial/Example”

  1. Great tutorial, my only issue is that my insert query always applies an insertId of 0. Therefore when I try to create additional records, identical (by rerunning the query) or not, I get a duplicate error.

    { [Error: ER_DUP_ENTRY: Duplicate entry '0' for key 'PRIMARY'] code: 'ER_DUP_ENTRY' , errorno: 1062, sqlState: '23000' , index: 0}

    Any idea how to make it so ID (PK field in DB) resumes from last and always increments?

Leave a Reply