Results 1 to 2 of 2
Aug 21, 2006, 06:57 #1
Slow nonlocal db connection in php script
I am connecting to a non local database...
I have a script that uses mysql and connects to the non local database in order to synchronize the local pc's database with the main system...
However, unless we are on the local network the mysql connections seem to be extremely slow and they never complete. The script ends up timing out...
We currently have aroun 1700 records that are updated... Sometimes the 10 queries are sent to the main system and sometimes 1500 are but never all of them... I was wondering if there is a better way to update the system... Does anyone have any experience with this sort of thing? I was thinking of writing all the queries to a sql file and using php to ftp the file to the main system.. Then have a cron script on the main site check for and read the file if it exists...
Would that be a better way to do it?
Aug 21, 2006, 07:10 #2
- Join Date
- Mar 2006
- 7 Post(s)
- 1 Thread(s)
You could export the entire database (using the command line mysqldump command), ftp it somewhere where it'll be picked up and imported? This'd be quite a tricky task to write, but once it's done you'd never need to look at it again!