使用sequelize连接mysql出错
发布于 7个月前 作者 telnetning 437 次浏览
#node 01.js
You need to install mysql package manually

/var/www/node/t_sequelize/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:306
    var connection = mysql.createConnection(connectionConfig);
                           ^
TypeError: Cannot call method 'createConnection' of undefined
    at module.exports.connect (/var/www/node/t_sequelize/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:306:28)
    at Object.pool.Pooling.Pool.create (/var/www/node/t_sequelize/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:131:19)
    at createResource (/var/www/node/t_sequelize/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:258:13)
    at dispense (/var/www/node/t_sequelize/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:250:9)
    at Object.me.acquire (/var/www/node/t_sequelize/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:316:5)
    at null.fct (/var/www/node/t_sequelize/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:241:19)
    at null.<anonymous> (/var/www/node/t_sequelize/node_modules/sequelize/lib/emitters/custom-event-emitter.js:24:18)
    at processImmediate [as _immediateCallback] (timers.js:330:15)

需要手动安装mysql?这个是什么意思呢?

2 回复

必须已经安装过了啊,难道必须手动安装?

回到顶部