nodejs 连接数据库报错 TypeError: Cannot read properties of undefined (reading 'connect') 代码如下图
怎呢解决?
https://blog.csdn.net/xiasohuai/article/details/80995946
数据库能连上不
conn没有connect方法,建议查一下文档,看看nodejs如何连接mysql
getConnection 里面为啥还要再connect呢,直接使用即可
// For pool initialization, see above
pool.getConnection(function(err, conn) {
// Do something with the connection
conn.query(/* ... */);
})