简体   繁体   中英

node connection to mysql db problems using node-orm

When I use connection without node-orm with node-mysql from this example works. But when I try to make smth like this it crashes. As i understood orm redesigned their api but haven't editted their wiki.

However this:

var db = orm.connect("mysql://username:password@hostname/database", function (success, db) {...});

dont crash but success is null too :(

How should I connect with orm to mysql?

似乎您正在使用旧的orm,请使用orm2,它将使用语法orm.connect("mysql://username:password@host/database", function (err, db) { if (err) throw err;

Had some issues with node-orm. Magic undebuggable errors... Try this: https://npmjs.org/package/light-orm (okey for simple dbs)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM