Unix Technical Forum

Accessing Database on another PC

This is a discussion on Accessing Database on another PC within the MySQL forums, part of the Database Server Software category; --> Hey guys, I've got a database set up on my local PC accessed as localhost. I want to be ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:27 AM
MarkP
 
Posts: n/a
Default 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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:27 AM
Good Man
 
Posts: n/a
Default 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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 11:27 AM
MarkP
 
Posts: n/a
Default 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 ??

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 11:27 AM
Good Man
 
Posts: n/a
Default 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...


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 11:27 AM
Good Man
 
Posts: n/a
Default 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)



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-28-2008, 11:27 AM
MarkP
 
Posts: n/a
Default 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 help..

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:51 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com