Answer:
Since you are using the database on the same application machine, the database connection configuration can be changed to:
<?php
$HOST = 'localhost:3388';
$USER= '*****';
$PASS= '*****';
$BANCO = 'gclient_embratel';
$conexao = mysql_connect($HOST,$USER,$PASS) or die('Não foi possivel conectar: '.mysql_error());
$selecao = mysql_select_db($BANCO);?
?>
Instead of the IP of your external machine defined in the variable $HOST
I put the value localhost
, but could also be used 127.0.0.1
.
How much the refused connection can occur by several factors, the main ones being:
The MySQL database service did not start and is not running on port 3388. If you use Linux you can do the fuser 3388/tcp
command to check for a process using that port. / li>
There are some restrictions on your machine's firewall for port 3388.
Are you using a Amazon Web Services
machine for your application? You need to release the port in the security settings of your instance.
By setting the localhost
value to the $HOST
variable, the 2
and 3
options are probably discarded because port 3388 on the local machine will be accessed without external access.