Short answer...
No it can't be done. as is.
Long Answer:
No it cant be done, but there are some "solutions"
1) Install a cluster. Un less you install a DB cluster between your PC and your Server
Pros: This will keep your DB up to date instantly.
Cons: this is not an easy configuration trick, and requieres a very hight knowledge.
MySQL Cluster info: [
www.mysql.com]
2) Make a pseudo cluster, in your app make a log of all sql altering transactions (INSERTS, UPDATES) on any table, and from your Localhost read that log and apply it locally every X time.
Pros: This can emulate the cluster functionality
Cons: This could cause some "data sync" crashes if you modify the same info in localhost and livehost.
3) Download your DB file (as you are doing right now)
Pros: You just need to download your file.
Cons: This solution becomes inefficent when the DB becomes bigger in size. But you can Even corrupt your DB files, if PHP take more that 30 secs to download it (or any time especified in you PNP.INI -> Maxexecutiontime). You can even corrupt your production server DB, and lost your data, so be carefull.
4) Connect to liveserver directly. This is maybe the most easy and cheapper solution, in your localserver scripts. detect if servername == localhost then inestead of connecting to mysql server "localhost" connect directly to your "SERVER_IP", also you must configure your Server to accept external connections (if you have a dedicate IP is betther) to the MySQL server And to the data base.
Pros: you access directly to your server so all data is the same locally and globally
Cons: you are opening a port to the world so you need to be carefull and not open it globally, so take considerations about restricting acces to your ISP IP ranges only (or to your IP only) maybe make a script that grant global access to your dinamic IP only for a few time then remove the access.
Personally, I dont care about this because "in house" servers are only for development so all data is just to test, propouses (all data is downloaded via SQL dumps), and all vital data is in the production server. Only when needed, I do the Option 4, and restrict the acces only to my actuall IP (that is dedicated, on my office, but it cost me some additional money), but also some times I activated the access to my home IP that is dinamic. Just remember to UNGRANT access to NON using IPs.
I also had inplemented the Option 2, for a customer that has 2 services running Local and Global, but as I told you. this can cause, some "collisions" when same data is modified in both sides, then you must inplement a "versioning and priority system" with rules. or a warning system that says that X or Y data is dupplicated and as some admin for the solution.