Run Localhost XAMPP from a remote MySQL DB File

Irgendwelche Probleme mit XAMPP für Windows? Dann ist hier genau der richtige Ort um nachzufragen.

Run Localhost XAMPP from a remote MySQL DB File

Postby dfaunce » 13. March 2018 14:13

Can I run a localhost instance of PHP/MySQL (using XAMPP) and point the database connection to a remote database file on a server?

I designed a PHP web-based system for daily tasks at work using MySQL db and running via XAMPP (Localhost). It turned out to be pretty successful in that the entire (small) department required it. I tried to get program this installed on the company servers and create a company intranet site so that the department can use it, but IT insists that only the .NET languages (C++, C#, VB, etc...) are allowed on servers and only MS SQL Server can be used.

I have access to a virtual server, I was wondering if I could place the MySQL Database file on the server and point everybody's localhost instances to that server file. I know it seems counter-intuitive that a "localhost" would use a remote database connection - but I wanted to know if this is possible?

Thanks in advance
Posts: 1
Joined: 13. March 2018 14:11
XAMPP version: 3.2.1
Operating System: Windows 7

Re: Run Localhost XAMPP from a remote MySQL DB File

Postby Nobbie » 13. March 2018 16:35

Of course it is possible, simply provide the IP of the remote server instead of localhost in the mysql_connect() call (or mysqli). You must of course create a user with sufficient rights on the remote MySQL server which is allowed to connect from your client PCs. But technically there is no problem, only the speed mayba a concern, as all data then is passed via network (WLAN, LAN or whatever) and that might be far slower than localhost transfer speed.
Posts: 10279
Joined: 09. March 2008 13:04

Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 7 guests