I am trying to do a connect from Java to my DB, but I have a type error:
“com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.”
I have the host, port, username and password of the infinityfree panel.
What could that be? I have read a bit on stackoverflow, but ask infinityfree directly.
Either using with client or native code from other server, iFastnet still “treats” them as “external/remote connection”.
Only Premium account can do that in here.
For Free account, you can only connect it from iFastnet’s whitelist IP (e.g.: their free reseller hosting such as InfinityFree).
Also, you can never ping any servers, because the ‘ping’ protocol is not required to host websites, it is disabled & The way SQL works (A bit like adisp007) but it is a local IP, 192.168.0.xxx, That means that that IP is only accesible through the hosting platform. And if you try to connect externally, it will say Connection Refused,
I’m sorry, but what do you see has changed since that time? Two years ago, someone reported the exact same error message, and I said that time that this was not possible on free hosting and required premium hosting. That statement is still true today.
Not in this context. In this context, “client” is defined in the context of a client-server model, which means “anything that wants to connect to the server”. With the server obviously being our MySQL database server.
There is of course the mysql-client software library and command line tool. While this software is an example of a client to connect to a MySQL server, we’re not specifically referring to this software.
You can only connect to our free databases with PHP code on our hosting or through our phpMyAdmin installation. You cannot connect to the databases from anywhere else with any software, tool, application, script, programming language or library.
I do not understand the argument that you comment, when in my second comment I already realize that you have to be premium. I do not understand this argument, it does not make sense to reaffirm what I already said.
You have to take this with tweezers.
If you call “everything” that tries to connect client, then that argument is valid.
If it is understood as a “client” software already programmed with all infrastructures by infinityfree to make the connection, this argument is not valid.
What is said depends on how the client is interpreted.
I have a question for what you tell me, if you have the remote connections to the database is “capped”, how can PHP make a mysql connection with the database “capped”?
What’s more, if you ping the DB, it doesn’t respond. Could you explain to me how PHP connects to the “capada” database with a free account? I don’t know.
Everyone says that it can be done with PHP and the database is capped, I just want to know how you do it. I think you have to have a premium account and so if you can use PHP for the mysql connection, that would make more sense.
It is not capped in the sense of being able to access, If you know basic MySQL Server, then you know that you can assign users specific ‘listening IP’s’ and make it so a user can only connect through a certain IP,
As above, the user ‘root’ has access from any IP, which is alright as it is an isolated testing environment, however;
The owncloud user can only connect from localhost, hence meaning, that any connections from the IP (10.0.2.6) will be refused with the, Obvious, Connection Refused, and PHP connects, through the local IP, which is allowed, also the fact that the MySQL server listens on an INTERNAL ip address, accessible only through the server network, on which the webserver’s work, It’s like when you go to your wifi admin page (192.168.0.1), But if you try to access the same ip on mobile data, It won’t work,And the connection will be refused, because it is LOCAL only
And the server, is configured as below;
bind-address = 10.0.2.6
Meaning that connections from any other IP linked to the server, will be refused, Ergo, Connection Refused.
The ‘client’ in this case, Is always going to be the website, In the case of an API hosting, the client is an API client, And with webhosting, it is not ‘Free mysql hosting for you to use everywhere and maybe abuse it’ it is ‘MySQL Hosting for your HOSTED website’, The client is defined in the access rules of the server, the client could be anything, but in this case, it is HOSTED websites.
Also… I don’t know why your arguing, Nothing is going to change.
Then I must have misunderstood the argument I was responding to.
When you said “It is that we seem new …” and “If the guidlines haven’t changed it should work that way.” pointing to another topic, I interpreted this as “look, in this post you can see it worked in the past, and now it doesn’t work anymore, but it should work unless the rules have changed”.
When trying to make sense of questions and answers, it’s good to establish common terminology to make sense of the information.
For this purpose, I elaborated on my definition of “client”, to help clarify some of the other things I said. So of course, everything I said only makes sense if you use my definition of client to understand it.
If it helps you, would you prefer to use a different word instead? If so, what word would you use to describe “something (e.g. a tool, library, software package) that’s used to connect to a MySQL database server”?
The database connection from PHP and phpMyAdmin are done over the internal network.
Suppose you’re reading this post from your computer at home. Generally speaking, your home will only have one IP address which is used to connect to the wider internet. When you try to open this forum page, your computer will connect to your router, which takes over the internet connection to forward it to the forum server. Our forum server then sends the web page back to your home IP address, from where your router forwards it to your computer.
But that explains how the forum server interacts with your router, but how does your router interact with your computer? It does so over the internal network. If you check your computer’s network settings, you’ll see it has an IP address assigned to it, which generally looks like 192.168.xxx.xxx. This IP address allows other devices within your home (like your router) to connect to your computer. But devices outside of your home network cannot connect to these devices.
If you want to connect to the admin interface of your router, or connect to something like a NAS, you also enter the internal IP address of this device in your browser. But this only works if you are connected to your home network. If you enter this IP address from anywhere else in the world, it will not work.
If you want to connect to your NAS or your router admin from anywhere else, you have to setup Port Forwarding in your router, which maps a port from your single home IP address to be forwarded to an internal IP address in your home network.
This is how it works for our database servers as well. Our database servers have an internal IP address, just like your own computer. But the network is not of a home, but of a datacenter. And like your NAS or router portal at home, the database servers can only be accessed from the internal datacenter network, not from anywhere else.
If you check what IP address sql204.epizy.com has, for example, you’ll see that it points to 192.168.0.174. Note that this IP address starts with 192.168 too, just like the IP address of your home computer. That’s because every IP address starting with that section is an internal IP address.
Our website servers and phpMyAdmin server also run in this internal network. Like your computer can connect to your NAS, our website servers can connect to our database servers over the internal network.
To make the database servers accessible from the internet, we would have to setup an IP address which is accessible from the rest of the internet, and either assign it directly to the database servers or setup port forwarding. But we don’t want our database servers to be accessible from the rest of the internet, so there is no external IP address or port forwarding set up.
I hope this explains a bit about how internal and external networking works, and why you cannot connect to your database with us from elsewhere.
Thanks for giving me networking class, I have returned to the first year of engineering, what times were those.
Personally, I thought it was a helionet-like host or others of this type, that is, with remote addresses enabled and routes.
The main problem is that infinityfree closes or does not enable remote connections to the database, due to security and data overload. For this reason, only the internal IP or the internal IP assigned or binded in the configuration document will work. As you well say.
In that case, I’ll use internal PHP as the documentation recommends.
In my second comment, I already realize that I cannot connect to the DB, because as I said, I cannot ping the host of my database.
In the future I will look at prices if I see that infinityfree meets my expectations.
Helionet (last time I checked) uses cPanel. cPanel’s behavior is to put everything on the same server: websites, databases, DNS, email and so on. So the database server automatically gets a public IP address, because otherwise the server would be unusable at all.
Although that doesn’t prevent the server operator from setting up firewall rules or access control rules to restrict who can access what service on the server, of course.
We have separate servers for everything, and optimize the configuration and specification of each server for the specific purpose it serves. For the database servers, this means that it doesn’t need to be accessible from the internet.
Please note that our web servers also cannot be pinged, even though those are accessible from the web. All ping requests to our network are blocked, so you can’t really use ping to tell if a service is running or not.