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

**URL:** <https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576>\
**Category:** Hosting Support\
**Created:** [November 19, 2022, 11:43pm UTC](https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576 "2022-11-19T23:43:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon59680983](https://forum.infinityfree.com/letter_avatar/anon59680983/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon59680983](https://forum.infinityfree.com/u/anon59680983)\
**Post date:** [November 19, 2022, 11:43pm UTC](https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576/1 "2022-11-19T23:43:27Z")

</div>

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

[http://server2001.infinityfreeapp.com/](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.

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [November 19, 2022, 11:45pm UTC](https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576/2 "2022-11-19T23:45:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![anon59680983](https://forum.infinityfree.com/letter_avatar/anon59680983/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon59680983](https://forum.infinityfree.com/u/anon59680983)\
**Post date:** [November 19, 2022, 11:59pm UTC](https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576/3 "2022-11-19T23:59:20Z")

</div>

This is whole error log for FTP.

| Status: | Resolving address of [ftpupload.net](http://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](http://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 |

---

<div class="post-metadata">

**Author:** ![anon46092769](https://forum.infinityfree.com/letter_avatar/anon46092769/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon46092769](https://forum.infinityfree.com/u/anon46092769)\
**Post date:** [November 20, 2022, 12:06am UTC](https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576/4 "2022-11-20T00:06:37Z")

</div>

> [@anon59680983](#):
>
> 127.0.0.1:21

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):

> [@Help, I cannot connect to FTP](https://forum.infinityfree.com/t/help-i-cannot-connect-to-ftp/49307):
>
> Being able to access your hosting account over FTP is very important to manage your website files. However, there are reason why you may have trouble connecting to the FTP service. This article explains a few things you can try to fix your FTP connection. Login to your control panel After your account has been created, or reactivated after a suspension, you may need to login to the hosting control panel once to enable FTP access to your account. You can login to the control panel by logging in…

---

<div class="post-metadata">

**Author:** ![anon59680983](https://forum.infinityfree.com/letter_avatar/anon59680983/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon59680983](https://forum.infinityfree.com/u/anon59680983)\
**Post date:** [November 20, 2022, 12:07am UTC](https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576/5 "2022-11-20T00:07:58Z")

</div>

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](http://sqlxxx.epizy.com) (10060). I use heidsql from my local computer.

Kind regards.

---

<div class="post-metadata">

**Author:** ![anon59680983](https://forum.infinityfree.com/letter_avatar/anon59680983/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon59680983](https://forum.infinityfree.com/u/anon59680983)\
**Post date:** [November 20, 2022, 12:09am UTC](https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576/6 "2022-11-20T00:09:45Z")

</div>

Thanks it worked in fact.

FTP issue is gone now.

---

<div class="post-metadata">

**Author:** ![anon46092769](https://forum.infinityfree.com/letter_avatar/anon46092769/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon46092769](https://forum.infinityfree.com/u/anon46092769)\
**Post date:** [November 20, 2022, 12:12am UTC](https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576/7 "2022-11-20T00:12:33Z")

</div>

> [@anon59680983](#):
>
> Can’t connect to server on [sqlxxx.epizy.com](http://sqlxxx.epizy.com) (10060)

> [@anon59680983](#):
>
> I use heidsql

I believe that this applies for your SQL issues:

> [@Connecting to MySQL from an external application](https://forum.infinityfree.com/t/connecting-to-mysql-from-an-external-application/49339):
>
> Sometimes, you may want to connect to your MySQL database on your free hosting account using external software, like a desktop database manager (like MySQL Workbench) or an external program you wrote yourself (like an Android or iOS app). You cannot connect to a free hosting MySQL database from outside your hosting account. You can only interact with your free hosting database through PHP scripts uploaded to your free hosting account, or through our phpMyAdmin installation. The ability to con…

---

<div class="post-metadata">

**Author:** ![anon59680983](https://forum.infinityfree.com/letter_avatar/anon59680983/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon59680983](https://forum.infinityfree.com/u/anon59680983)\
**Post date:** [November 20, 2022, 3:55am UTC](https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576/8 "2022-11-20T03:55:05Z")

</div>

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](http://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.

```auto
<?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!");
	}
 ?>

```

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [November 20, 2022, 4:31am UTC](https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576/9 "2022-11-20T04:31:14Z")

</div>

> [@anon59680983](#):
>
> Curl error 52: Empty reply from server

Likely due to this

> [@Ensuring only web browsers can access your website](https://forum.infinityfree.com/t/ensuring-only-web-browsers-can-access-your-website/49353):
>
> InfinityFree is a website hosting service. That means that the hosting accounts we provided are intended for hosting websites. Websites contain pages that are accessed through web browsers. InfinityFree is not intended to be used for file sharing, API hosting, database hosting or background tasks/tools. To help enforce this, free hosting enforces a security system that makes sure that anyone trying to access your website is using a normal web browser. This is done by checking whether the web br…

and this

> [@Connecting to MySQL from an external application](https://forum.infinityfree.com/t/connecting-to-mysql-from-an-external-application/49339):
>
> Sometimes, you may want to connect to your MySQL database on your free hosting account using external software, like a desktop database manager (like MySQL Workbench) or an external program you wrote yourself (like an Android or iOS app). You cannot connect to a free hosting MySQL database from outside your hosting account. You can only interact with your free hosting database through PHP scripts uploaded to your free hosting account, or through our phpMyAdmin installation. The ability to con…

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [November 20, 2022, 10:01am UTC](https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576/10 "2022-11-20T10:01:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [November 27, 2022, 10:01am UTC](https://forum.infinityfree.com/t/cant-connect-to-ftp-and-mysql-even-if-website-is-ready/68576/11 "2022-11-27T10:01:41Z")

</div>

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