Windows 10 can't connect to remote server, information correct

[expired user #10088]'s profile image [expired user #10088] posted 8 years ago in General Permalink

Hello,

So I am running windows 10 on my machine with the latest HeidiSQL, I have a remote mySQL server running which has been working for over 2 years now (the desktop is new). I am on an IP that is allowed in the server settings (my laptop can connect fine from the exact same network). Yes, I am using the correct username / password.

The laptop is running an older version of heidiSQL and windows 7, I have been using that laptop to connect for over a year but would really appreciate if someone could share some insight as to why a Windows 10 desktop wouldn't be able to connect.

Thanks in advantage, Krulvis

1 attachment(s):
  • thunderbird_2016-09-08_01-01-15
ansgar's profile image ansgar posted 8 years ago Permalink

"Access denied" says you're hitting the server. Watch out for the IPv6 address in the error message, which is yours on the client side. Probably you need to let your user come from "%", not from "127.0.0.1", "10.%" or whatever you entered on the servers user table.

[expired user #10088]'s profile image [expired user #10088] posted 8 years ago Permalink

The IP I connect from is allowed, I can connect from the same IP fine with a different PC (laptop)

[expired user #10088]'s profile image [expired user #10088] posted 8 years ago Permalink

If anyone could help me that'd be really nice, I am still having this issue.

[expired user #10088]'s profile image [expired user #10088] posted 8 years ago Permalink

I've got some additional information. When connecting from my laptop (changing the username a bit so it is purposely incorrect) I get an error message saying "access denied for user "username" @ a.<my_IP>.<my_ISP>.nl".

But when I connect from my windows 10 desktop (same internet connection). I get an error message saying access denied for "username" @ IPV6 address (instead of the external address that my laptop connects from). It's almost like my desktop is trying to connect with it's IPv6 address and therefore can't make a connection.

Thanks in advantage!

ansgar's profile image ansgar posted 8 years ago Permalink

That's what I meant above:

"Access denied" says you're hitting the server. Watch out for the IPv6 address in the error message, which is yours on the client side. Probably you need to let your user come from "%", not from "127.0.0.1", "10.%" or whatever you entered on the servers user table.

[expired user #10088]'s profile image [expired user #10088] posted 8 years ago Permalink

But why would I have to set that on the server's table, this seems like a client issue, not server related at all.

ansgar's profile image ansgar posted 8 years ago Permalink

Because the server has to know from which ip or host you are coming. That's why usernames are combined with an ip/host, e.g. root@localhost or root@127.0.0.1, or root@10.1.% or whatever.

[expired user #10088]'s profile image [expired user #10088] posted 8 years ago Permalink

The server isn't located in my home network meaning it only sees my external IP as the source, this IP is actually allowed and I can confirm this since my laptop can connect fine from the same IP as the desktop.

Can you state somewhere in the HeidiSQL client settings what IP it uses as source?

ansgar's profile image ansgar posted 8 years ago Permalink

You cannot specify the client IP in HeidiSQL, as it's automatically detected by libmysql.dll. And as the messages states, you're definitely hitting that server with the 2001:980:45cb:1:511d:f198:b845:7b60.

ansgar's profile image ansgar posted 8 years ago Permalink

Sorry, one mistake: the IP is not automatically detected by libmysql.dll, but the server detects it. (I guess, and I'm very sure HeidiSQL doesn't)

[expired user #10088]'s profile image [expired user #10088] posted 8 years ago Permalink

Then that's a mistake in HeidiSQL ? Why would it try to connect to a server outside it's own network with it's IPv6 address? And how could I every specify in the server that that is allowed ? I can't just add IPv6 addresses in the server's user table, right ?

kalvaro's profile image kalvaro posted 8 years ago Permalink

Choosing the network interface used to stablish an outgoing connection is really far from the scope of a regular application. Even web browsers won't allow you to do more than setting an HTTP proxy.

If you aren't really interested in using IPv6 I suggest you just disable it system-wide. If you open the "Properties" dialogue of your network connection you can uncheck "IPv6" and save changes.

kalvaro's profile image kalvaro posted 8 years ago Permalink

BTW, Windows has a route command line utility to add exceptions to the local IP routing table (I've used it myself to access certain MySQL/FTP sites that have IP-restricted access from my work PC, where we have two different internet provides) but I don't really know if it allows choosing the protocol.

[expired user #10088]'s profile image [expired user #10088] posted 8 years ago Permalink

Choosing the network interface used to stablish an outgoing connection is really far from the scope of a regular application. Even web browsers won't allow you to do more than setting an HTTP proxy.

If you aren't really interested in using IPv6 I suggest you just disable it system-wide. If you open the "Properties" dialogue of your network connection you can uncheck "IPv6" and save changes.

I don't mind using IPv6 but I don't understand why the server doesn't allow the connection. For all I know it simply has to accept the IP of my network (which is allowed) I don't have to specify anything more specific for my laptop either on the server's user table

If you could add me on skype that'd be really nice as I don't really understand how I can mask the IPv6 connection. Skype: krulvis

[expired user #10088]'s profile image [expired user #10088] posted 8 years ago Permalink

Okay, I just figured out my home network also has a IPv6 address it uses when making use of the IPv6 protocol within the network. Excuse me, didn't know this. But now I am stuck on adding the IPv6 of my home network to the user table. Is there any specific way you have to add this ?

[expired user #10088]'s profile image [expired user #10088] posted 8 years ago Permalink

Alright, I just tested the connection on my Desktop using Intellij instead of HeidiSQL and it's working fine.

kalvaro's profile image kalvaro posted 8 years ago Permalink

I suspect there's a misunderstanding around the concept of access restricted by IP address. When a given user is assigned such a restriction in MySQL Server (something entirely optional, because you can always use a wildcard to allow access from any IP address), the server determines if the restriction is met by checking what IP address the client is connecting from. The client does not report the IP address himself because that would defeat the purpose of the restriction: you could always claim any arbitrary IP address, whether it's true or not.

But now I am stuck on adding the IPv6 of my home network to the user table. Is there any specific way you have to add this ?

As far as I know the procedure is exactly the same—being IPv4 or IPv6 doesn't change anything. This is what my local mysql.user table looks like:

mysql> SELECT Host, User FROM mysql.user WHERE User='root' ORDER BY Host;
+-----------+------+
| Host      | User |
+-----------+------+
| 127.0.0.1 | root |
| ::1       | root |
| localhost | root |
+-----------+------+
3 rows in set (0.00 sec)

Please login to leave a reply, or register at first.