How to connect?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dakky

    #1

    How to connect?

    Let's say I got

    $db_name = "your_database" ;
    $username = "your_user" ;
    $password = "your_MySQL_pas sword";

    I'm not sure about

    $db_server = "mysql.server.c om";

    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


  • Andy Hassall

    #2
    Re: How to connect?

    On Thu, 16 Dec 2004 23:02:58 +0100, "Dakky" <NOSPAMdakky@hi .htnet.hr> wrote:
    [color=blue]
    >Let's say I got
    >
    >$db_name = "your_database" ;
    >$username = "your_user" ;
    >$password = "your_MySQL_pas sword";
    >
    >I'm not sure about
    >
    >$db_server = "mysql.server.c om";
    >
    >Although I got a domain name. How to find out what is SQL hostname?[/color]

    Ask your host.
    [color=blue]
    >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)[/color]

    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.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • Dakky

      #3
      Re: How to connect?

      "Andy Hassall" <andy@andyh.co. uk> wrote in message
      news:tv14s0pliv luaflkr34ivbn4s n9amkm0a7@4ax.c om...[color=blue]
      >[color=green]
      > >Although I got a domain name. How to find out what is SQL hostname?[/color]
      >
      > Ask your host.[/color]

      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...
      [color=blue]
      > It depends. Whether you're on the right side of a firewall. Whether[/color]
      there's a[color=blue]
      > database listening at all. And so on...[/color]

      Understand...


      Comment

      • Michael Fesser

        #4
        Re: How to connect?

        .oO(Dakky)
        [color=blue]
        >Let's say I got
        >
        >$db_name = "your_database" ;
        >$username = "your_user" ;
        >$password = "your_MySQL_pas sword";
        >
        >I'm not sure about
        >
        >$db_server = "mysql.server.c om";
        >
        >Although I got a domain name. How to find out what is SQL hostname?[/color]

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

        Micha

        Comment

        • JV

          #5
          Re: How to connect?

          Dakky wrote:[color=blue]
          > I'm not sure about
          > $db_server = "mysql.server.c om";
          > 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)
          >[/color]

          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

          Comment

          Working...