Connecting Tech Pros Worldwide Forums | Help | Site Map

Which mysql server am I on?

Bruce A. Julseth
Guest
 
Posts: n/a
#1: Sep 26 '05
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
Guest
 
Posts: n/a
#2: Sep 26 '05

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@attglobal.net
==================
Bruce A. Julseth
Guest
 
Posts: n/a
#3: Sep 27 '05

re: Which mysql server am I on?



"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:8eCdncKK9rJYsaXeRVn-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@attglobal.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


Malcolm Dew-Jones
Guest
 
Posts: n/a
#4: Sep 27 '05

re: Which mysql server am I on?


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

: "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
: news:8eCdncKK9rJYsaXeRVn-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@attglobal.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.
Jerry Stuckle
Guest
 
Posts: n/a
#5: Sep 27 '05

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@attglobal.net
==================
Closed Thread