Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/09/2016, 00:01
dfmex
 
Fecha de Ingreso: octubre-2008
Mensajes: 147
Antigüedad: 15 años, 6 meses
Puntos: 3
Exclamación No puedo conectarme a mi MySQL remoto... ¿Qué hago mal?

Hola Amigos

Tengo un hospedaje web en hosting24.com con cPanel que admite conexiones remotas a MySQL, y tengo otro dominio hospedado en iPage.com que no admite conexiones a MySQL remotas.

Bien, en el dominio de iPage intento conectarme al hospedado en hosting24.com via PHP para extraer información de MySQL y almacenarla como respaldo, entonces sucede que me sale el siguiente error:

Cita:
Can't connect to MySQL server on '31.220.105.105' (111)
Pero, mismo usuario, contraseña, IP desde SQLyog si se conecta desde mi PC sin problema alguno, incluso hice una prueba con la consola MySQL:

Cita:
mysql -h 31.220.105.105 -u factu460_factura -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2548
Server version: 5.6.31 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+------------------------+
| Database |
+------------------------+
| information_schema |
| factu460_facturasite |
+------------------------+
3 rows in set (0.40 sec)
Mi Script en PHP es el siguiente:

Código PHP:
<?php
define
('DB_SERVER''31.220.105.105:3306'); // Server IP and PORT
define('DB_USERNAME''factu460_factura'); // DataBase User
define('DB_PASSWORD''*******'); // DataBase Password
$Conexion mysql_connect(DB_SERVERDB_USERNAMEDB_PASSWORD) or die(mysql_error());
?>
Este script lo tengo alojado en el dominio hospedado en iPage.com, y el servicio de hospedaje web de Hosting24.com si acepta conexiones remotas.

Última edición por dfmex; 04/09/2016 a las 00:13