尝试在windows 10计算机上配置节点和mysql数据库

fhg3lkii  于 2021-06-20  发布在  Mysql
关注(0)|答案(0)|浏览(202)

我找遍了,找不到解决办法。这是我的密码:

var express    = require("express");
 var mysql      = require('mysql');
 var connection = mysql.createConnection({
   host     : 'localhost',
   user     : 'root',
   password : 'pass',
   database : 'mysql_db',
   port: 3306
 });
 var app = express();

 connection.connect(function(err){
 if(!err) {
     console.log("Database is connected ... \n\n");
 } else {
     console.log("Error connecting database ... \n\n");
 }
 });

 app.listen(3306, 'localhost');

我使用命令“nodemon server.jsx”运行它,得到错误:

Error: listen EACCES 127.0.0.1:3306
    at Object._errnoException (util.js:992:11)
    at _exceptionWithHostPort (util.js:1014:20)
    at Server.setupListenHandle [as _listen2] (net.js:1338:19)
    at listenInCluster (net.js:1396:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1505:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)

有人能帮我吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题