Re: MySQL - separating web and database servers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Operator wrote:

On 18 Mar 2004 at 14:24, Ricardo Lopes wrote:


in your php.ini you have mysql.default_host, mysql.default_user and
mysql.default_password which are used if:

a) you are not in safe mode
b) you supply no string for those parameters.

But i guess this is not your case, i think this doesnt help,


Exactly...


but i had an
ideia, you could set your server (http) to work as a router and make
something like a port-forwarding to the other server, like routers do, one
ip could be used be several machines, depending on the port is accessed the
data is forwarded to that port.

This is just an idea i had right now, i dont know if it can be used or if it
works but and least appears to logical and implementable.
Good luck.


And this is how I want it to be done, but in the "localhost case" unix socket is used, not 127.0.0.1:3306 which I could forward wherever I want.

Probably I need to change this behaviour in ext/mysql/libmysql/libmysql.c for my installation, but this is my last hope (mostly because I'm not a C programist...) If some of you could tell me if it's possible without breaking something else, or point me to the lines that do the job... I suppose the change needed would be quite simple.

PB

I agree with all of the others, you should not be hacking your way around this as it will make lots of problems. You just need to tell your users to switch their scripts to using the new host.


Here's the solutions I use. Put all of your connection info in one include and include it any time you need to connect. This way, you have only one file to change, ever.

--
paperCrane <Justin Patrin>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux