How to connect?

This is a discussion on How to connect? within the PHP Language forums, part of the PHP Programming Forums category; Let's say I got $db_name = "your_database"; $username = "your_user"; $password = "your_MySQL_password"; I'm not ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-16-2004
Dakky
 
Posts: n/a
Default How to connect?

Let's say I got

$db_name = "your_database";
$username = "your_user";
$password = "your_MySQL_password";

I'm not sure about

$db_server = "mysql.server.com";

Although I got a domain name. How to find out what is SQL hostname?
If I had that hostname, would that be enough to connect to the mySQL
database (if I dont got access to the server itself, i.e. no FTP access or
similar)

Thanks in advance


Reply With Quote
  #2 (permalink)  
Old 12-16-2004
Andy Hassall
 
Posts: n/a
Default Re: How to connect?

On Thu, 16 Dec 2004 23:02:58 +0100, "Dakky" <NOSPAMdakky@hi.htnet.hr> wrote:

>Let's say I got
>
>$db_name = "your_database";
>$username = "your_user";
>$password = "your_MySQL_password";
>
>I'm not sure about
>
>$db_server = "mysql.server.com";
>
>Although I got a domain name. How to find out what is SQL hostname?


Ask your host.

>If I had that hostname, would that be enough to connect to the mySQL
>database (if I dont got access to the server itself, i.e. no FTP access or
>similar)


It depends. Whether you're on the right side of a firewall. Whether there's a
database listening at all. And so on...

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Reply With Quote
  #3 (permalink)  
Old 12-17-2004
Dakky
 
Posts: n/a
Default Re: How to connect?

"Andy Hassall" <andy@andyh.co.uk> wrote in message
news:tv14s0plivluaflkr34ivbn4sn9amkm0a7@4ax.com...
>
> >Although I got a domain name. How to find out what is SQL hostname?

>
> Ask your host.


Let's say my host is theplanet.com and I really don't want to wait days to
get response so could you please tell me if you know...

> It depends. Whether you're on the right side of a firewall. Whether

there's a
> database listening at all. And so on...


Understand...


Reply With Quote
  #4 (permalink)  
Old 12-17-2004
Michael Fesser
 
Posts: n/a
Default Re: How to connect?

.oO(Dakky)

>Let's say I got
>
>$db_name = "your_database";
>$username = "your_user";
>$password = "your_MySQL_password";
>
>I'm not sure about
>
>$db_server = "mysql.server.com";
>
>Although I got a domain name. How to find out what is SQL hostname?


In many cases the database runs on the same machine as the webserver, so
you can simply connect to 'localhost'. Try that.

Micha
Reply With Quote
  #5 (permalink)  
Old 12-30-2004
JV
 
Posts: n/a
Default Re: How to connect?

Dakky wrote:
> I'm not sure about
> $db_server = "mysql.server.com";
> Although I got a domain name. How to find out what is SQL hostname?
> If I had that hostname, would that be enough to connect to the mySQL
> database (if I dont got access to the server itself, i.e. no FTP access or
> similar)
>


ultimately andy is correct that you should consult the persons hosting
the site (if its virtual site or not).

if you have shell access to the server to modify your code... can you
use the prompt db client 'mysql' if so the chances are its on the
'localhost'
else if you have to enter a -h flag for the command its most likely else
where and thats the db's address

if you do not have shell access (ssh, ftp, telnet...etc) (?how are you
writing the code files) then you best bet is just to try 'localhost'
first then try 'yourdomain.com' just in case access is disabled from the
localhost.

.... will expound on request.

hth
JV
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:17 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0