Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to connect to MySQL when host is not on Port 80 1

Status
Not open for further replies.

VBRookie

Programmer
May 29, 2001
331
US
I have IIS and Apache installed on the same box. IIS is listening to port 80 and I have apache configured to listen to port 90.

When I try to connect to the MySQL database using mysqli_connect I keep getting the error 'Unknown MySQL server host 127.0.0.1:90.

This is what my connection string looks like:

mysqli_connect ("127.0.0.1:90", "root", "pass", "prodDB", "3306")

I also changed my php.ini to set the mysqli.default_host = 127.0.0.1:90

Any ideas?
- VB Rookie
 
MySQL doesn't run on port 90, it uses 3306 by default.

 
I have mysql on port 3306. The webserver is on port 90 ...
 
The webserver's port is irrelevant. It will connect to MySQL on port 3306, unless you've changed MySQL's configuration.

Hint: 127.0.0.1:90 is also an invalid host address. Remove the ":90
 
Oh I see ...

Thank you so much ... works beautifully now ...

okeeday,
- VB Rookie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top