chchrist
chchrist

Reputation: 19842

Connect to a mysql db on another pc on the same network

I have three pcs and each one runs xampp. I want the other two use the third pc's mysql database in order to have only one database for development and not three.. How should I setup my pcs to work like this?

Thanks in advance

Upvotes: 1

Views: 3751

Answers (3)

Oren Hizkiya
Oren Hizkiya

Reputation: 4434

Configure a static IP for the computer hosting the database. When you use PHP to connect to the database from one of the other computers, set the host to this IP. Also make sure you have commented out #bind-address = 127.0.0.1 in my.ini as TJHeuvel noted.

Upvotes: 0

jojo
jojo

Reputation: 41

Open the mysql connection on php code running on the first two pcs, setting for both the ip of third as db_host.

Upvotes: 1

TJHeuvel
TJHeuvel

Reputation: 12618

You'll have to change the my.ini to listen to TCP/IP, as described here http://www.howtogeek.com/howto/mysql/switch-mysql-to-listen-on-tcp/

Upvotes: 0

Related Questions