Jump to content

[SOLVED] Copying MySQL Table Data To Another Server


Monadoxin

Recommended Posts

Hello, I was wondering how to best approach copying table data to another server.

 

I want to be able to loop through all of the table's rows, and add them to the other server's database. But there may be some rows that already exist over on the other server, I would like to update those ones with the new information.

 

I would rather not have to add grants to the other server's database tables. Multiple servers will be running this PHP script. That means there would need be a wild card IP address to connect. It wouldn't be very secure to allow anyone to connect.

 

I am at a loss on how to proceed. Obviously I don't want raw information to be sent through the internet, so I need to do this in a secure way. I was thinking I could just encrypt the information before sending it, but I am unsure of how to send it.

 

If anyone has any suggestions on where to start it would be appreciated.

It is possible, but since this will be running from a lot of different servers, I would need to add GRANTS to allow those servers to connect. So I would most likely end up having to allowing any IP address to connect. It would be a lot easier, but I cannot do it this way.

 

This will be a cron script that will be executed every day.

If it's running through a bunch of scripts, why not push an single point to access the MySQL server, like an API.... where the other scripts call this single (set of) script(s) that update/insert where needed. Then create a separate MySQL user with limited permissions (such as just update/insert) on the single script's IP. That way even if that user got compromised, the least amount of damage could be done.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.