Friday, 15 March 2013

node.js - Sequelize and MySQL with MAMP, I get an error -



node.js - Sequelize and MySQL with MAMP, I get an error -

i problem sequelize express (node.js). seek connect mysql database mamp mac sequelize express doesn't work, don't understand why got error:

maybe have edit mysql configuration file comment "mamp_skip-networking_mamp" don't find mysql conf file mac...

my code:

var sequelize = require("sequelize"); var db = new sequelize('express', 'root', 'root', { host: '127.0.0.1', port: '3306' }); var project = db.define('project', { date: sequelize.date, title: sequelize.string, description: sequelize.text }); var project = project.build({ date: new date(), title: 'mon premiéé projeétçç!!', description: 'dsqlmdskq lkqskl ksqlmk lsmdqklm' }); project .save();

try this:

var sequelize = require("sequelize"); var db = new sequelize('express', 'root', 'root', { host: '127.0.0.1', port: '3306' }); var project = db.define('project', { date: sequelize.date, title: sequelize.string, description: sequelize.text }); db.sync().success(function() { var project = project.build({ date: new date(), title: 'mon premiéé projeétçç!!', description: 'dsqlmdskq lkqskl ksqlmk lsmdqklm' }); project.save(); })

mysql node.js express sequelize.js

No comments:

Post a Comment