You are here: Re: Retrieving MySQL server's port value with PHP « PHP Programming Language « IT news, forums, messages
Re: Retrieving MySQL server's port value with PHP

Posted by Jerry Stuckle on 03/19/07 13:36

Mitesh wrote:
> Thanx Jerry:
>
> Fine point
>
> Gordon Burditt wrote:
>>> I think I have no alternative than to open the MySQL ini file through
>>> PHP
>> Hopefully, you do not have permission necessary to do that.
>> It's going to be especially difficult if the server is on a different
>> machine from PHP.
>
> Thanx Gordon:
>
> Ah! I didn't supply enough information. Actual the above is not a
> problem for me right now. But can be in future version of the app.
> Currently the PHP is only accessed by the administrator and the
> administrator and the servers (both MySQL and Apache) is on the same
> machine.
>
> But in the future spec version 2.0 I do see a requirement that the
> administrator should be able to log on into the system from any one
> of the LAN machines. So that can be a problem.
>
> I think Jerry's way should solve this problem too. The configuration
> exe is run on the machine where the servers are located.
>

One word of caution. Other machines are going to expect MySQL to be
using port 3306. Their PHP installations won't be affected by the
change to the original php.ini. So if you're going to be accessing
MySQL from PHP (or any other language, for that matter) on a different
port, you'll have to specify it in the mysql_connect() (or equivalent) call.

I just find it easier to go ahead and leave it on 3306. And if you're
thinking of moving it for security reasons - forget it. It takes about
30 seconds to find every open port on your system - and the script is
only a half dozen lines long. It might take another minute (and 5 lines
of script) to determine which port MySQL is actually using.

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация