Can't connect to FTP and MYSQL even if website is ready

This is my website. You can check the website is ready to start.

http://server2001.infinityfreeapp.com/

However, I can not connect to FTP and MYSQL server using the user id and password provided from the control panel.

Is there any additional steps to do to make FTP and MYSQL to work ?

I have used many other hosting service. Most of time FTP and MYSQL just should work when the website is ready.

For your information, I created the website hosting about 11 hours ago.

My question is FTP and MYSQL are required to wait longer to work even after the website is ready ?

Or something else could be the problem ?

Please help.

Kind regards.

Welcome!

In the control panel, make sure that you have a database created.

If you are still having troubles with MySQL, can you share the error message(s)?

as for FTP, what error are you getting?

3 Likes

This is whole error log for FTP.

Status: Resolving address of ftpupload.net
Status: Connecting to 127.0.0.1:21…
Status: Connection attempt failed with ECONNREFUSED - Connection refused by server.
Error: Could not connect to server
Status: Waiting to retry…
Status: Resolving address of ftpupload.net
Status: Connecting to 127.0.0.1:21…
Status: Connection attempt failed with ECONNREFUSED - Connection refused by server.
Error: Could not connect to server

That is not the FTP IP address. It looks like your router or ISP is blocking it.
Please try connecting directly to 185.27.134.11 or ftp.epizy.com.
Refer to this article for more information (and more troubleshooting info):

7 Likes

I created one database in my sql server. Then I tried to connect again. But I got this error message.

Can’t connect to server on sqlxxx.epizy.com (10060). I use heidsql from my local computer.

Kind regards.

Thanks it worked in fact.

FTP issue is gone now.

1 Like

I believe that this applies for your SQL issues:

7 Likes

I placed this register.php file with code under htdoc folder in my hosting.

When I execute this code from the client PC.

I am keep getting Curl error 52.

Curl error 52: Empty reply from server

Is there anything I have to enable to make this php works your mysql provided from infinityfree.net ?

I used the mysql user name and password and host name from the control panel.

For your information, this php code was running fine before with other hosting.

<?PHP

	Require("Config.php");
	
	$user = $_POST['username'];
	$pass = $_POST['password'];
	$email = $_POST['email'];
	
	$link = mysql_connect($host, $username , $password) or mysql_error();

	if (!$link)
	{
		die('Could not Connect: ' . mysql_error());
	}
	   
	mysql_select_db($database , $link) or die ("could not load the database" . mysql_error());
	 
	$check = mysql_query("SELECT * FROM $table WHERE `username`='".$user."'" ) or die (mysql_error());

	if(mysql_num_rows($check) == 0)
	{
		if($user != null)
		{
			if($pass != null)
			{
				if($email != null)
				{
					$query = mysql_query("INSERT INTO $table ( `id` , `username` , `password` , `email`) VALUES ( '' , '$user' , '$pass' , '$email') ; ");
					if($query)
					{
						die ("Successfully created account!");
					}
					else
					{
						die ("Error: " . mysql_error());
					}
				}
				else
				{ 
					echo("Invalid email");
				}
			}
			else
			{
				echo("Invaid password");
			}
		}
		else
		{
			echo("Invalid username");
		}
	}
	else
	{
		die("User already exists!");
	}
 ?>

Likely due to this

and this

4 Likes

A few thing I see in your code that may cause issues:

  • I see you’re using mysql_ functions for database connectivity. Those were deprecated in PHP 5.5 and removed with PHP 7.0. So for this code to run on any non-outdated PHP version, you need to rewrite the code to use either mysqli_ functions or PDO.
  • I don’t understand the line mysql_connect(...) or mysql_error(). The first returns the database connection, the second an error message string, and or always returns a boolean (which, given that the connection is either successful or it isn’t, is always true). So the if (!$link) condition can never be hit. Either remove the or mysql_error() from that line or change it to something like or die(mysql_error()) (which prints the error message and stops execution).
  • You’re dumping the $user value straight from post input into the query string. This is extremely unsafe and leaves your code wide open to SQL injection. Make sure to always sanitize/validate user input before sending it to the database or, better yet, use parameterized queries.
5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.