Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Application started on port 56642
- [ undefined ]
- /Users/[username]/Desktop/[directory]/[directory]/web/node_modules/execsql/index.js:14
- callback(err, results);
- ^
- TypeError: callback is not a function
- var express = require('express');
- var bodyParser = require('body-parser');
- var mysql = require('mysql');
- var pool = mysql.createPool({
- host: 'localhost',
- user: "root",
- password: "password",
- database: "db_test"
- });
- var execsql = require('execsql'),
- dbConfig = {
- host: 'localhost',
- user: 'root',
- password: 'password'
- },
- sql = 'use db_test;',
- sqlFile = __dirname + '/database/create_tables.sql';
- execsql.config(dbConfig)
- .exec(sql)
- .execFile(sqlFile, function(err, results){
- console.log(results);
- }
- ).end();
- var execsql = require('execsql'),
- dbConfig = {
- host: 'localhost',
- user: 'root',
- password: 'password'
- },
- sql = 'use db_test;',
- sqlFileTwo = __dirname + '/database/seed_tables.sql';
- execsql.config(dbConfig)
- .exec(sql)
- .execFile(sqlFileTwo, function(err, results){
- console.log(results);
- }
- ).end();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement