简体   繁体   中英

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

打开在前两台计算机上运行的php代码上的mysql连接,将第三个IP都设置为db_host。

您必须更改my.ini才能侦听TCP / IP,如此处所述http://www.howtogeek.com/howto/mysql/switch-mysql-to-listen-on-tcp/

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM