
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:
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:Can't connect to MySQL server on '31.220.105.105' (111)
Cita:
Mi Script en PHP es el siguiente: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)
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)
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_SERVER, DB_USERNAME, DB_PASSWORD) or die(mysql_error());
?>