PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > MYSQL access is OK on Server but not from PC??
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
MYSQL access is OK on Server but not from PC??

Réponse
 
LinkBack Outils de la discussion
Vieux 03/11/2007, 12h58   #1
martin99
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut MYSQL access is OK on Server but not from PC??

Hi,

I can run a test scrip that connects to the and it CONNECTS
successfully whilst running from the my website on the server.

$sqlhost = 'localhost';
$sqluser = 'userid';
$sqlpass = 'password';
$sqldb = 'some_dbd';

<?php
$conn=@mysql_connect($sqlhost,$sqluser,$sqlpass) OR die("Could not
cONNECT : " . mysql_errno().": ".mysql_error()."<BR>");
$rs=@mysql_select_db($sqldb, $conn) or die("Could not select the
database");
?>

<<<PROBLEM>>>

I cant seem to get access to my SQL data (on the server) via running a
PHP script locally on my PC

But when I try and change the SQLHOST from "localhost" to a real URL
(ie something like www.website.com (etc)) its does nt like and gets

Could not CONNECT : 1045: Access denied for user
'userid'@'5ac4ba15.bb.sky.com' (using password: YES)

  Réponse avec citation
Vieux 03/11/2007, 13h18   #2
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: MYSQL access is OK on Server but not from PC??

martin99 wrote:

> I cant seem to get access to my SQL data (on the server) via running a
> PHP script locally on my PC


To be able to connect to a local mysql server (localhost), you need to have
mysql server installed on the computer and have started teh service and of
course have the same database/tables as on the web-server.


> But when I try and change the SQLHOST from "localhost" to a real URL
> (ie something like www.website.com (etc)) its does nt like and gets
>
> Could not CONNECT : 1045: Access denied for user
> 'userid'@'5ac4ba15.bb.sky.com' (using password: YES)


This means that you aren't allowed to connect with your username/login
remotely to the sql server and I doubt your web-host will allow you, as it's
always a security risk to let people to login from a remote site, specially is
you have a dynamic ip-address.


I do suggest you visit www.distrowatch.com and download a proper OS that
allows you to select to install Apache, MySQL, PHP and a lot more during the
installation of the OS, this way you have all working by default and will keep
on working after updates.


--

//Aho
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h13.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10614 seconds with 10 queries