Hi

I have a MYSQL DB hosted on a Win 2003 server on my LAN
and a Mysql DB on a dedicated (linux) server at our ISP.

I would like to dump a few tables to a .sql file and ftp it to the server and then import the .sql file automatically via a cron job.

I can do the FTP etc. But I am unable to get the exporting and importing to work, not sure why.

I would really appreciate some assistance

I am not an expert in importing and exporting but form what i heard you should use python for this kind of jobs

Member Avatar for diafol

@fab: Care to share the code you have?

The other option could be to create a web service (or a REST JSON webservice) and have the provider in your ISP that takes the data and store it in your ISP and the client that gives the data in local machines.

You should be able to do this easily with a small php script. Make sure that the shebang line at the top is correct (ask your host for the path to php), and that the file containing the code is set as executable. These are problems I've had in the past.

Another problem I've had is that it seems mysql will only accept one command at a time from a script, so you can't send it a whole script, but must send each command individually, or they just won't be carried out.

Hi

thanks for the replies

I managed to get my script to work, but the question is can I do this whilst the DB is live every 2 Hrs?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.