The Wayback Machine - https://web.archive.org/web/20201013035059/https://github.com/cube-js/cube.js/issues/733
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding CUBEJS_DB_PASSWORD alias for CUBEJS_DB_PASS #733

Open
gokulanv opened this issue Jun 18, 2020 · 8 comments
Open

Adding CUBEJS_DB_PASSWORD alias for CUBEJS_DB_PASS #733

gokulanv opened this issue Jun 18, 2020 · 8 comments

Comments

@gokulanv
Copy link

@gokulanv gokulanv commented Jun 18, 2020

Describe the bug
A clear and concise description of what the bug is.
Error: ER_ACCESS_DENIED_ERROR: Access denied for user ''@'' (using password: NO)

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Used these keys -
CUBEJS_DB_HOST
CUBEJS_DB_NAME
CUBEJS_DB_PORT
CUBEJS_DB_PASSWORD
CUBEJS_DB_USER
CUBEJS_DB_TYPE
CUBEJS_API_SECRET

Server -
CubejsServerCore.create({
dbType: 'mysql',
schemaPath: path.join('src', 'schema')
}).initApp(app);

When I run a query, I get this error -
Error: ER_ACCESS_DENIED_ERROR: Access denied for user ''@'' (using password: NO)
So, I am not able to connect to remote MySQL DB.

@vasilev-alex
Copy link
Member

@vasilev-alex vasilev-alex commented Jun 22, 2020

Hi @gokulanv!

This error is most likely caused by wrong credentials/host etc. Cube.js does not restrict you from using a remote DB.

Could you try connecting to the DB directly and see if the error persists?
mysql -u username -pMyPassoword -h example.com

@gokulanv
Copy link
Author

@gokulanv gokulanv commented Jun 22, 2020

@vasilev-alex
I am able to connect to the DB directly and I am able to connect from a node js app with 'mysql' npm too. But not able to connect with cube.js

Is this config right?

CUBEJS_DB_HOST
CUBEJS_DB_NAME
CUBEJS_DB_PORT
CUBEJS_DB_PASSWORD
CUBEJS_DB_USER
CUBEJS_DB_TYPE
CUBEJS_API_SECRET

Server -
CubejsServerCore.create({
dbType: 'mysql',
schemaPath: path.join('src', 'schema')
}).initApp(app);

@vasilev-alex
Copy link
Member

@vasilev-alex vasilev-alex commented Jun 22, 2020

ok, looks like you should use CUBEJS_DB_PASS over CUBEJS_DB_PASSWORD

@gokulanv
Copy link
Author

@gokulanv gokulanv commented Jun 22, 2020

Yes, I just saw that from the documentation and changed it. Thanks, works now

@gokulanv gokulanv closed this Jun 22, 2020
@vasilev-alex vasilev-alex changed the title Not able to connect to database hosted in remote server. Error: ER_ACCESS_DENIED_ERROR: Access denied for user '<X>'@'<Remote IP Address>' (using password: NO) Adding CUBEJS_DB_PASSWORD alias for CUBEJS_DB_PASS Jun 24, 2020
@vasilev-alex vasilev-alex reopened this Jun 24, 2020
@vasilev-alex vasilev-alex added enhancement and removed question labels Jun 24, 2020
@gokulanv
Copy link
Author

@gokulanv gokulanv commented Jun 24, 2020

@vasilev-alex Would love to start contributing to CubeJs starting with this issue. Can I make a PR for the same?

@vasilev-alex
Copy link
Member

@vasilev-alex vasilev-alex commented Jun 24, 2020

@gokulanv yes, would be great!

@gokulanv
Copy link
Author

@gokulanv gokulanv commented Jun 29, 2020

@vasilev-alex I have updated all the driver js files to read CUBEJS_DB_PASSWORD as well. Can you please direct me to the instructions to test the changes?

@vasilev-alex
Copy link
Member

@vasilev-alex vasilev-alex commented Jun 29, 2020

@gokulanv I don't think we have tests for that. You can just run it and see if that works. I'll also take a look at the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.