Question

Locked

Accessing mysql database on a lan pc using php function

By hafsansari ·
Hi all,
i am using php at front end and mysql as dabase server. My problem is that i want to put my database server on another pc and access it through lan connection using php. Can anyone tell me what php function should i use and what parameters should be passed in it?

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Well first PHP is the middle not the front.

by Tony Hopkinson In reply to Accessing mysql database ...

Two sides to this as far as the connection string goes, you just put the ip address/name of the new server in there.

What ever account the php is running under (apache or IIS ??) needs permission to access the mysql server, and it the webserver needs to be able to see it it on the network.

Nothing to do with php as such, except for pointing your connection at the relevant server.

Collapse -

myPhpAdmin

by rickvill In reply to Accessing mysql database ...

I have two PC's namely PC1 and PC2.
PC1 has a program that runs myPhpAdmin using MySql as database.
these two PC's are connected via local network.
my Question: How can I set PC2 to connect to the program in PC1.
ive tried typing the ip address of PC1 on PC2 webbowser. it didnt work.
please help me.
thanks

Collapse -

First things first

by Tony Hopkinson In reply to Accessing mysql database ...

can PC2 hit PC1 as a webserver at all.

It should have a default web page (index.htm) or some such.
If you can't hit that from PC2, phpmyadmin is irrelevant.
If you can, then type in the full address of phpmyadmin's home page from PC1, on PC2, see what happens.
PHPMyadmin is just a set of web pages on PC1, if it's working on there it then where mysql is doesn't matter.
Your problem is PC2 can't see PC1 as a webserver, or PC2's user isn't allowed to use PHPAdmin.

Collapse -

network

by rickvill In reply to Accessing mysql database ...

PC2 can ping PC1.
In PC1, I just use http://localhost/rickvill .... rickvill here is just a file name.
when I try to typ PC1 ip address on PC 2's browser. it doesnt work.
What must I set first?

Collapse -

settings

by rickvill In reply to Accessing mysql database ...

Thanks for the advise Mr. Hopkins Sir.
I just check the Windows Firewall and add port exception my program in PC1.
It works fine now. I can access it in PC2.
Thanks a lot sir.

Back to Networks Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums