Skip to content

I can't connect to my remote MySQL #838

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

Closed
ondev opened this issue May 31, 2014 · 1 comment
Closed

I can't connect to my remote MySQL #838

ondev opened this issue May 31, 2014 · 1 comment
Labels

Comments

@ondev
Copy link

ondev commented May 31, 2014

I have install MysQL on my vps. The nodejs app run on the vps call connect to MySQL.
But the nodejs app run on local, can't connect to remote MySQL.
Error is: Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'192.244.222.28' (using password: YES)

I connect config is:

var connection = mysql.createConnection({
  host     : '192.244.202.22',
  port     : '3306',
  user     : 'user',
  password : 'pass',
  database : 'mydata'
 });

I setup the host is 192.244.202.22(This is my vps ip), why the ip in the error log is 192.244.222.28(This is my local router ip).

Any one know it?

@dougwilson
Copy link
Member

Hi! This has nothing to do with this module and is a general grant question about MySQL. MySQL can be set to allow user/password combinations from only certain hosts. You need to set MySQL to allow to authenticate as your user from the IP 192.244.222.28

dveeden pushed a commit to dveeden/mysql that referenced this issue Jan 31, 2023
PR mysqljs#838 introduced a fix for the driver's custom Value Converter that
stopped emitting large uint64 `driver.Value`s as a string. Instead, now
_all_ uint{8,16,32,64} values passed to the driver are returned as
uint64, and `packets.c` now explicitly handles `driver.Value` instances
that are uint64.

However, the update in `packets.c` only applies when sending
`driver.Value` arguments to the server. When a connection is set up
using `InterpolateParams = true` and query interpolation happens inside
of the driver, the `(*mysqlConn) interpolateParams` does **not** handle
uint64 values (which, again, are now passed by `database/sql` because
we've updated our value converter to generate them).

Because of this, any `DB.Query` operations which have an uint argument
(regardless of its size!!) will force the driver to return
`driver.ErrSkip`, disabling client interpolation for such queries.

We can fix this by updating `interpolateParams` like we previously
updated `writeExecutePacket`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants