Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/07/2012, 22:56
drago_013
 
Fecha de Ingreso: julio-2012
Mensajes: 3
Antigüedad: 11 años, 10 meses
Puntos: 0
Pregunta Conexión php a base de datos remota

Saludos Comunidad de forosdelweb

Este es mi primer post, así que ojalá me puedan ayudar, el problema es el siguiente:

Sucede que tengo instalado el Xampp en mi ordenador e intento conectarme mediante el siguiente script en php

Código PHP :
Código PHP:
<?php
   Conectar
();
   function 
Conectar(){
      
$servidor 'server';
      
$usuario  'user';
      
$clave    'pass';
      
$bd       'db';

      
$conexion mysqli_connect($servidor,$usuario,$clave) or die("No se pudo conectar");
      
mysql_select_db($bd,$conexion) or die("No se pudo conectar a la base de datos");
      
mysql_query("SET NAMES 'utf8'");   
      return 
$conexion;
   }
?>
a una base de datos remota de mysql pero me aparece el siguiente mensaje de error

--------------------------------------------------------------------------------------------------------
Warning: mysqli_connect() [function.mysqli-connect]: Premature end of data (mysqlnd_wireprotocol.c:553) in C:\xampp\htdocs\html\test_con\conexion.php on line 9

Warning: mysqli_connect() [function.mysqli-connect]: OK packet 1 bytes shorter than expected in C:\xampp\htdocs\html\test_con\conexion.php on line 9

Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in C:\xampp\htdocs\html\test_con\conexion.php on line 9
No se pudo conectar
--------------------------------------------------------------------------------------------------------
He intentado conectar conectarme con los mismos parámetros de conexión con workbench y no tengo ningún problema pero, no es lo que necesito.

Así que se agradece la ayuda.