Error: connect ECONNREFUSED 127.0.0.1:3306 at TCPConnectWrap.afterConnect [as oncomplete] (net.j

控制台:
Error: connect ECONNREFUSED 127.0.0.1:3306
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)
--------------------
at Protocol._enqueue (D:\桌面文件\vue电商项目\vue_api_server\node_modules\mysql\lib\protocol\Protocol.js:144:48)
at Protocol.handshake (D:\桌面文件\vue电商项目\vue_api_server\node_modules\mysql\lib\protocol\Protocol.js:51:23)
at PoolConnection.connect (D:\桌面文件\vue电商项目\vue_api_server\node_modules\mysql\lib\Connection.js:119:18)
at Pool.getConnection (D:\桌面文件\vue电商项目\vue_api_server\node_modules\mysql\lib\Pool.js:48:16)
l.js:49:25)
at Object.connect (D:\桌面文件\vue电商项目\vue_api_server\node_modules\orm\lib\ORM.js:118:12)
at Object.module.exports (D:\桌面文件\vue电商项目\vue_api_server\node_modules\orm\lib\Express.js:12:7)
at Object.exports.express (D:\桌面文件\vue电商项目\vue_api_server\node_modules\orm\lib\ORM.js:168:31)
at Object.initialize (D:\桌面文件\vue电商项目\vue_api_server\modules\database.js:32:14)
at Object. (D:\桌面文件\vue电商项目\vue_api_server\app.js:21:10)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
数据库: MySQL 数据库连接不上
问题:数据库名称不对
解决: 1. 打开后台数据库命名文件夹 config 找到数据库命名项
2.更改database项中命名.
3.重启控制器,重新连接数据库,
问题解决!
MySQL数据库连接成功

你可能感兴趣的:(排坑指南,数据库,node.js)