Which mysql server am I on?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bruce A. Julseth

    Which mysql server am I on?

    I do my development on a local machine with "localhost" as my mysql server.
    And, of course, I have different server when in production. So that I don't
    have to modify my code when I promote, I first connect to my production
    server. If that fails, I connect to my local server. Is this the best way,
    or is there a better way? Is there a way to detect which MySQL server is
    currently available to me?

    Thanks...





  • Jerry Stuckle

    #2
    Re: Which mysql server am I on?

    Bruce A. Julseth wrote:[color=blue]
    > I do my development on a local machine with "localhost" as my mysql server.
    > And, of course, I have different server when in production. So that I don't
    > have to modify my code when I promote, I first connect to my production
    > server. If that fails, I connect to my local server. Is this the best way,
    > or is there a better way? Is there a way to detect which MySQL server is
    > currently available to me?
    >
    > Thanks...
    >
    >
    >
    >
    >[/color]

    I just keep a configuration file in a directory below Apache root
    directory so it can't be accessed from the web. The file contains
    things like system names, user id's and passwords. I just include this
    file to access the info.

    The file is different on different systems, but it resides in the same
    location relative to $_SERVER['DOCUMENT_ROOT'].

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Bruce A. Julseth

      #3
      Re: Which mysql server am I on?


      "Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
      news:8eCdncKK9r JYsaXeRVn-1w@comcast.com. ..[color=blue]
      > Bruce A. Julseth wrote:[color=green]
      >> I do my development on a local machine with "localhost" as my mysql
      >> server. And, of course, I have different server when in production. So
      >> that I don't have to modify my code when I promote, I first connect to my
      >> production server. If that fails, I connect to my local server. Is this
      >> the best way, or is there a better way? Is there a way to detect which
      >> MySQL server is currently available to me?
      >>
      >> Thanks...
      >>
      >>
      >>
      >>
      >>[/color]
      >
      > I just keep a configuration file in a directory below Apache root
      > directory so it can't be accessed from the web. The file contains things
      > like system names, user id's and passwords. I just include this file to
      > access the info.
      >
      > The file is different on different systems, but it resides in the same
      > location relative to $_SERVER['DOCUMENT_ROOT'].
      >
      > --
      > =============== ===
      > Remove the "x" from my email address
      > Jerry Stuckle
      > JDS Computer Training Corp.
      > jstucklex@attgl obal.net
      > =============== ===[/color]

      My production server is on GoDaddy. I haven't checked yet, but I doubt
      GoDaddy will allow me to go outside of my "Paid" space. I know I cannot
      create a table via PHP. I have to use their "manual" interface. Of course, I
      can load the table with data using PHP.

      If my guess is correct, anybody have any other suggestions?

      Thanks..

      Bruce


      Comment

      • Malcolm Dew-Jones

        #4
        Re: Which mysql server am I on?

        Bruce A. Julseth (bruceajNoSpam@ attglobal.net) wrote:

        : "Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
        : news:8eCdncKK9r JYsaXeRVn-1w@comcast.com. ..
        : > Bruce A. Julseth wrote:
        : >> I do my development on a local machine with "localhost" as my mysql
        : >> server. And, of course, I have different server when in production. So
        : >> that I don't have to modify my code when I promote, I first connect to my
        : >> production server. If that fails, I connect to my local server. Is this
        : >> the best way, or is there a better way? Is there a way to detect which
        : >> MySQL server is currently available to me?
        : >>
        : >> Thanks...
        : >>
        : >>
        : >>
        : >>
        : >>
        : >
        : > I just keep a configuration file in a directory below Apache root
        : > directory so it can't be accessed from the web. The file contains things
        : > like system names, user id's and passwords. I just include this file to
        : > access the info.
        : >
        : > The file is different on different systems, but it resides in the same
        : > location relative to $_SERVER['DOCUMENT_ROOT'].
        : >
        : > --
        : > =============== ===
        : > Remove the "x" from my email address
        : > Jerry Stuckle
        : > JDS Computer Training Corp.
        : > jstucklex@attgl obal.net
        : > =============== ===

        : My production server is on GoDaddy. I haven't checked yet, but I doubt
        : GoDaddy will allow me to go outside of my "Paid" space. I know I cannot
        : create a table via PHP. I have to use their "manual" interface. Of course, I
        : can load the table with data using PHP.

        But that doesn't stop you from having a config file as part of the
        application.

        : If my guess is correct, anybody have any other suggestions?

        : Thanks..

        : Bruce



        --

        This programmer available for rent.

        Comment

        • Jerry Stuckle

          #5
          Re: Which mysql server am I on?

          Bruce A. Julseth wrote:[color=blue]
          >
          >
          > My production server is on GoDaddy. I haven't checked yet, but I doubt
          > GoDaddy will allow me to go outside of my "Paid" space. I know I cannot
          > create a table via PHP. I have to use their "manual" interface. Of course, I
          > can load the table with data using PHP.
          >
          > If my guess is correct, anybody have any other suggestions?
          >
          > Thanks..
          >
          > Bruce
          >
          >[/color]

          I don't know about GoDaddy, but are you sure? I've seen several hosting
          companies where I can access the directory immediately below the
          document root.

          But if you can't, just place the config file in a directory protected by
          ..htaccess. I just prefer having it outside the document root to ensure
          no one else can get to it.

          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          Working...