0

I am a relative noob for learning node js and have used yeoman to generate an application for the feathers js framework based on their getting started video.

This process generates a config/default.js for connecting to the MySQL database that looks something like the following.

{
  "host": "localhost",
  "port": 3030,
  "mysql": "mysql://root:@localhost:3306/item",
  "public": "../public/",
  "auth": {
    "idField": "id",
    "token": {
      "secret": "(long secret string)"
    },
    "local": {}
  }
}

When I run npm start, then I get an error of...

Unhandled rejection SequelizeAccessDeniedError: ER_ACCESS_DENIED_ERROR:    Access denied for user 'root'@'localhost' (using password: NO)...

So I need to add a password to the "mysql" string value, but I am not sure how to add the password value to that string. I have tried adding "password" as a separate variable and modifying the "mysql" string in various ways, to no avail. All of the examples for sequelize (which feathersjs apparently uses for the ORM) show parameters for MySQL on separate lines rather than in one string.

So does anyone know what format the mysql string should use so as to include the password in the string?

bkudrle
  • 71
  • 7

1 Answers1

4

OK. It turned out to not be so difficult. The format for the "mysql" string that includes the password is simply the following.

"mysql": "mysql://root:password@localhost:3306/dbname"

Hope that helps someone.

bkudrle
  • 71
  • 7