1602 / compound

MVC framework. Built on Node.JS. Works on server and browser.
http://compoundjs.com
1.6k stars 182 forks source link

npm issue? connection.connect err { [Error: ER_ACCESS_DENIED_ERROR... #615

Closed darrendb closed 10 years ago

darrendb commented 10 years ago

Hi, I have an older compoundjs project that works just fine, in terms of connecting to my MAMP's mysql. I can do compound db update, compound seed [plant/harvest].

Recently I've created a new project from scratch. I have updated npm (v1.4.4), nodejs (v0.10.5), and almost all of the packages listed in package.json. I did a 'compound init PROJECT' and a 'compound g crud ...' the new project fails to connect. I get the following even just trying to start the server with 'npm start' :

Compound server listening on localhost:4024 within development environment
connection.connect err { [Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES)]
  code: 'ER_ACCESS_DENIED_ERROR',
  errno: 1045,
  sqlState: '28000',
  fatal: true }

If I replace the contents of the node_modules folder with that of the working older project, connections work fine without changing any code (server.js, database.js).

So it would seem obvious that i have one or more new versions of some packages that are either broken or not compatible. But with each package having its own set of dependencies, I'm not sure exactly where to start troubleshooting.

Here is my new-broken package.json (ive added comments on each dependency listing the version number found in each node_modules/package.json:

{ "name": "new-broken project"
, "engines": ["node >= 0.8.0"] //v0.10.5
, "main": "server.js"
, "dependencies":
  { "ejs": "*" //0.8.5
  , "ejs-ext": "latest" //0.1.4-5
  , "express": "~3.x" //3.5.0
  , "compound": ">= 1.1.0" //1.1.13-1
  , "jugglingdb": "0.2.x" //0.2.12
  , "jugglingdb-mysql": "latest" //0.0.8
  , "coffee-script": ">= 1.1.1" //1.7.1
  , "stylus": "latest" //0.42.3
  , "seedjs": "latest" //0.0.5
  , "co-assets-compiler": "*" //0.0.1-3
  },
  "devDependencies":
  { "nodeunit": "*" //0.8.6
  , "sinon": "*" //1.9.0
  , "supertest": ">= 0" //0.9.0
  , "mocha": ">= 0" //1.17.1
  , "should": ">= 0" //3.1.3
  , "semicov": "*" //0.1.1-2
  , "co-generators": "*" //0.0.1-8
  }
  ...
}

Here is my old-working package.json:

{ "name": "old-working project"
  , "engines": ["node >= 0.8.0"]
  , "main": "server.js"
  , "dependencies": {
      "ejs": "*" //0.8.4
    , "ejs-ext": "latest" //0.1.4-5
    , "express": "~3.x" //3.4.0
    , "compound": ">= 1.1.0" //1.1.7-9
    , "jugglingdb": ">= 0.2.x" //0.2.0-40
    , "jugglingdb-mysql": ">=0.0.1-7" //0.0.1-7
    , "coffee-script": ">= 1.1.1" //1.6.3
    , "stylus": "latest" //0.38.0
    , "seedjs": "latest" //0.0.4-7
    , "co-assets-compiler": "*" //0.0.1-3
  }
  , "devDependencies": {
      "nodeunit": "*" //0.8.1
    , "sinon": "*" //1.7.3
    , "supertest": "0.8.0" //0.8.0
    , "mocha": ">= 0"
    , "should": ">= 0" //1.3.0
    , "semicov": "*" //0.1.1-2
    , "co-generators": "*" //0.0.1-8
   ...
  }

Anyone have similar issues, or have any suggestions on how to figure out which package(s) should be most likely suspects? Not sure how to proceed, other than to revert to old versions circa ~ early 2013...

1602 commented 10 years ago

It's mysql error. Sometimes npm packages got updated. Sometimes it may cause some issues. Copying node_modules is not a proper solution. To get a proper solution you can start with googling error message and learn more about particular error you're getting. Good luck.

anatoliychakkaev commented 10 years ago

I assume if you use older mysql version it should work.

On 13 March 2014 10:21, Anatoliy Chakkaev notifications@github.com wrote:

Closed #615 https://github.com/1602/compound/issues/615.

Reply to this email directly or view it on GitHubhttps://github.com/1602/compound/issues/615 .

randunel commented 10 years ago

I just tried a fresh project with compound and jugglingdb-mysql and it worked as expected, so I don't think there is an 'updated-dependency' problem. Have you got any other relevant information regarding this issue? The mysql version I tested with is 5.5.35, protocol version 10.

darrendb commented 10 years ago

Resolved. Thanks Randune, with your input I ruled out version conflicts. I had already proven it wasn't an issue with my config/database.js or server.js since the same code worked with older node_modules but didn't work with new modules. I then assumed there was some cache/conflict lodged in the global modules. So i found a few posts on stackoverflow on how to remove global npm installs. After running that and npm cache clean for good measure I reinstalled fresh copies of my packages globally and locally and that seems to have done the trick. Now I can get back to actual development.