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 > Accessing Database on another PC
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Accessing Database on another PC

Réponse
 
LinkBack Outils de la discussion
Vieux 19/09/2007, 22h27   #1
MarkP
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Accessing Database on another PC

Hey guys,

I've got a database set up on my local PC accessed as localhost. I
want to be able to use something like SQLYOG to get to the database
from a laptop on the same network. I guess the question is what form
does the host field take if I'm trying to access the database from
another PC / laptop ?? if my database is on a PC with a name of say
PC1, what do I need to do to access it from the laptop ??

Cheers,
Mark.

  Réponse avec citation
Vieux 19/09/2007, 22h33   #2
Good Man
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Accessing Database on another PC

MarkP <mark_paceyuk@yahoo.co.uk> wrote in news:1190237251.536182.67650
@r29g2000hsg.googlegroups.com:

> Hey guys,
>
> I've got a database set up on my local PC accessed as localhost. I
> want to be able to use something like SQLYOG to get to the database
> from a laptop on the same network. I guess the question is what form
> does the host field take if I'm trying to access the database from
> another PC / laptop ?? if my database is on a PC with a name of say
> PC1, what do I need to do to access it from the laptop ??


Use the IP, it will be easier.

  Réponse avec citation
Vieux 19/09/2007, 22h42   #3
MarkP
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Accessing Database on another PC

On 19 Sep, 22:33, Good Man <he...@letsgo.com> wrote:
> MarkP <mark_pace...@yahoo.co.uk> wrote in news:1190237251.536182.67650
> @r29g2000hsg.googlegroups.com:
>
> > Hey guys,

>
> > I've got a database set up on my local PC accessed as localhost. I
> > want to be able to use something like SQLYOG to get to the database
> > from a laptop on the same network. I guess the question is what form
> > does the host field take if I'm trying to access the database from
> > another PC / laptop ?? if my database is on a PC with a name of say
> > PC1, what do I need to do to access it from the laptop ??

>
> Use the IP, it will be easier.


Errr ok - but what's the syntax ??? do I literally just use the ip for
the host with the localhost password ??

  Réponse avec citation
Vieux 19/09/2007, 22h48   #4
Good Man
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Accessing Database on another PC

MarkP <mark_paceyuk@yahoo.co.uk> wrote in news:1190238147.131461.129340
@r29g2000hsg.googlegroups.com:

> On 19 Sep, 22:33, Good Man <he...@letsgo.com> wrote:
>> MarkP <mark_pace...@yahoo.co.uk> wrote in news:1190237251.536182.67650
>> @r29g2000hsg.googlegroups.com:
>>
>> > Hey guys,

>>
>> > I've got a database set up on my local PC accessed as localhost. I
>> > want to be able to use something like SQLYOG to get to the database
>> > from a laptop on the same network. I guess the question is what form
>> > does the host field take if I'm trying to access the database from
>> > another PC / laptop ?? if my database is on a PC with a name of say
>> > PC1, what do I need to do to access it from the laptop ??

>>
>> Use the IP, it will be easier.

>
> Errr ok - but what's the syntax ??? do I literally just use the ip for
> the host with the localhost password ??
>
>


yeah, its the same syntax:

@ $db = mysql_connect("the.ip.address.here", "yourUserName",
"yourPassword");

you will need to make sure that the user has permission to connect to the
database from a computer that is not 'localhost'.... this can be done by
setting the "Host" column in the table "mysql" to "%" for your particular
user...


  Réponse avec citation
Vieux 19/09/2007, 22h50   #5
Good Man
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Accessing Database on another PC

Good Man <heyho@letsgo.com> wrote in
news:Xns99B0B54044F57sonicyouth@216.196.97.131:


>> Errr ok - but what's the syntax ??? do I literally just use the ip
>> for the host with the localhost password ??
>>
>>

>
> yeah, its the same syntax:
>
> @ $db = mysql_connect("the.ip.address.here", "yourUserName",
> "yourPassword");
>
> you will need to make sure that the user has permission to connect to
> the database from a computer that is not 'localhost'.... this can be
> done by setting the "Host" column in the table "mysql" to "%" for your
> particular user...


i was assuming PHP usage there, by the way. if you just want to use
command line, just telnet/SSH to the other computer first and do it from
there (mysql -u USERNAME -p)



  Réponse avec citation
Vieux 19/09/2007, 23h00   #6
MarkP
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Accessing Database on another PC

On 19 Sep, 22:50, Good Man <he...@letsgo.com> wrote:
> Good Man <he...@letsgo.com> wrote innews:Xns99B0B54044F57sonicyouth@216.196.97.131:
>
> >> Errr ok - but what's the syntax ??? do I literally just use the ip
> >> for the host with the localhost password ??

>
> > yeah, its the same syntax:

>
> > @ $db = mysql_connect("the.ip.address.here", "yourUserName",
> > "yourPassword");

>
> > you will need to make sure that the user has permission to connect to
> > the database from a computer that is not 'localhost'.... this can be
> > done by setting the "Host" column in the table "mysql" to "%" for your
> > particular user...

>
> i was assuming PHP usage there, by the way. if you just want to use
> command line, just telnet/SSH to the other computer first and do it from
> there (mysql -u USERNAME -p)


Ok Cheers - the PHP side won't be affected as I can edit the files on
the PC via the laptop. I think there is a permission issue, and I'll
have a look as you said in the table. Just setting some new stuff at
the mo - so I'm trying to access it via SQLYOG - just didn't know
whether the ip address or name was enough to connect. I'll check the
permission stuff out tomorrow. Cheers for the ..

  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 19h47.


Édité par : vBulletin® version 3.7.2
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
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11528 seconds with 14 queries