Mysql IPv6 Connectivity - mysql

I want to configure mysql 5.7 on linux machine which is having IPV6 ip address. How can I connect server machine by client machine which is having IPV4 address. And which configuration parameters which I need to change to configure IPV6 connectivity.

If your server only has IPv6 and your client has only IPv4 then they cannot communicate without help from a third system. The most common ways are SIIT-DC gateways, server side reverse proxies to make the server reachable over IPv4, or client side proxies to allow the client to connect to IPv6 services.
IPv4 and IPv6 connectivity both depend on the network provider. You can set up tunnels, but native connectivity is strongly preferred.

Related

Setting up MySQL database behind a VPN address

I have a regular MySQL server running with XAMPP at port 3306 and accessible by my internet ip aswell my local ip (127.0.0.1), the ports are forwarded in my router. An account set up to be accessed from any IP, Everything works fine.
I'm trying to make this same server be accessible by AirVPN DNS address. So I've followed AirVPN instructions to remove the forwarded ports in my router and forward a new port at their VPN with a random number (lets go with 1111) with local port as 3306 and DNS named as xxx.airdns.org
So I open MySQL with XAMPP under port 3306, nothing changed in config file. I run the AirVPN port checker over 1111 and it signals as open. I also try at other sites that checks ports and signals open at xxx.airdns.org:1111
Though when I try to make a connection as usual it returns error (10060): Can't connect to MySQL server on 'xxx.airdns.org' (10060)
Resolutions I've tried:
Switch port values in MySQL config files matching with the ports open in AirVPN
bound address to VPN adapter bind-address="10.6.114.48"
repeated the options above in all different kind of port combinations and addresses
Disabled Firewall on Ethernet adapter of VPN as described here
I couldn't achieve success in this task. I'm looking for some enlightment so I can understand the process.
EDIT:
The connection is set only to TCP protocol. A port check done through airVPN and is registered at XAMPP & FIREWALL logs as accepted connections. Though trying to connect from a client I got no log from Xampp or Firewall, it gets timed out.
Sorry for "answer" type not just comment, but i dont have enough reputation here :)
Maybe the protocol ( TCP/UDP ) is your issue.
If you use UDP on your airVPN better check forwarding on your router - most of them
by default sets TCP only. Otherwise maybe change to TCP on your airVPN.
ISP provider often filter this protocol.
Issue: Consider that you can't connect to a service running "behind" some VPN server from a machine that's connected to that very same VPN service.
Solution: Connect from another machine to test your service properly.

Reverse proxy based on DNS for multiple mysql hosts

I've some mysql host in private network and would like to use a reverse proxy server (i.e. nginx) to connect with mysql-client to mysql host via reverse proxy server.
An example to better understand my answer:
suppose I've:
a mysql server with ip yyy.1
a mysql server with ip yyy.2
both in the network of a proxy server with ip XXX, and I associate to XXX the DNS mysql-server1.com and mysql-server2.com.
My goal is connect to mysql server yyy.1 when I use mysql client to connect to XXX by calling mysql-server1.com on port 3306, and similare when try mysql-server2.com on port 3306.
The problem with nginx is that I can't differenciate TCP request by server name, so in XXX server I should associate one port foreach mysql server, but this implies that every time I should change the port also in mysql client settings, and I don't wanna this!
There's some proxy-server that can accomplish that?
Could I use IP Table to route the request mysql-server1.com:3306 to localhost:[some port], where I could use [some port] in proxy setting to forward the requests to the server yyy.1?
This is impossible.
In the MySQL Client/Server protocol, the client never identifies the hostname to which it is attempting to connect to. Unlike in some other protocols, such as HTTP (with the Host header), the original name the client used to resolve an IP address from DNS is not preserved. TLS SNI is also not available, because TLS negotiation on a MySQL connection does not begin until the client reads the server capability flags to discover whether the server supports TLS, at which point the client asks to switch the connection to TLS... and this, of course, is after the connection is is already established.
In the MySQL Client/Server protocol, the server always talks first.
Your only options are for the proxy machine to listen on multiple IP addresses, with a DNS hostname pointing to each IP, and use the address to which the client connected to determine which server to use.
Or, each proxy instance listens on a separate port.
The protocol design prevents name-based virtual hosting.

ComputeEngine connect by CloudSQL IPv6

Google CloudSQL says the IPv4 is priced but IPv6 is free. So we can use the IPv6 to connect to CloudSQL instance without purchasing the IPv4 address. So when tried to connect from Google Compute Engine VM cant able to find IPV6 for that debian instance. How to connect CloudSQL from ComputeEngine using IPv6?
The problem is that currently Compute Engine does not support IPv6 (Yes, this is unfortunate). You can connect to your Cloud SQL instance using IPv6 from any host that supports it (for example, if you have an IPv6 at home).

Google Cloud SQL not connecting via ipv6 from mysqlworkbench on mac

Created a Google Cloud SQL instance.
Authorized my public IP to access the instance.
Created user with a password to use it.
Assigned IPv4 address to it.
I'm able to connect with the IPv4 address,
but not able to connect with the default IPv6 address.
I'm on Mac OSX Yosemite, 10.10.5 and my MySQLWorkbench is 6.2.4 (also tried with 6.3).
Any possible reason why I'm able to connect with IPv4 but not IPv6?
Just like you connect IPv4-to-IPv4 addresses, you need to connect IPv6-to-IPv6 addresses. Your ISP needs to support IPv6 and issue you an IPv6 prefix from which your IPv6 addresses originate. If you have IPv6 Privacy Extensions enabled on your Macintosh, your source IPv6 address will periodically change, and that could be a problem for your connection. Don't try to use Link-Local IPv6 addresses (start with fe80:). You will need Global IPv6 addresses (start with 2xxx: or 3xxx:).

Protocol used by JDBC to connect to MySQL on different Host

I want to know what is the protocol that is used by JDBC to connect to MySQL Database that is present on an other host.
My client has only http and https access restricted to his host. I want an application on an other host to communicate with that MySQL Database available on my client's host.
Please note my Client uses WINDOWS 2012 SERVER
He has asked me the protocols and ports my application is using to connect to MySQL so that he would enable them.
Request you to help.
By default mysql server uses 3306/tcp port but this is configurable. They should open up only the port that the server is listening on. Regarding the protocol it is mysql specific, you can find more info at the official documentation
By default MySQL server listens on port 3306/TCP. See manual for more details.
MySQL uses its own binary protocol over TCP to destination port 3306 to connect to the database. If you cannot get a path open betwee your client and the server for port 3306 maybe you can get the server configured to use a port that IS available to you. It would depend on who has the stricter rules, the network admins or the DBA :-)