arvix
Posts: 6
Joined: Wed May 04, 2016 12:26 pm

Mirroring mysql

Mon Jan 21, 2019 9:45 am

I have one poject where raspberry pi most of time must work offline and collect data in local mysql database. But when it get online in internet it must syncronice local database with outside server mysql. Who knows how get this. Simple Mysql replications is not suitable in this case.

Heater
Posts: 19571
Joined: Tue Jul 17, 2012 3:02 pm

Re: Mirroring mysql

Mon Jan 21, 2019 10:52 am

mysqldump might be what you are looking for:
https://mariadb.com/kb/en/library/mysqldump/

You will have to arrange some means to copy the dump file from your Pi to you other server.

I presume when you say "synchronize" you mean one way not both ways.
Slava Ukrayini.

User avatar
rpdom
Posts: 22352
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Mirroring mysql

Mon Jan 21, 2019 12:49 pm

Is there a reason that simple replication can't work? For example, the same table in both databases gets updated independently and the changes need to be merged rather than just replicated from one system to the other. MariaDB (replaced MySQL a while back) can just about handle that. I had, until recently, been doing that for the last two and a half years with four servers being updated and replicating the updates to each other.

arvix
Posts: 6
Joined: Wed May 04, 2016 12:26 pm

Re: Mirroring mysql

Mon Jan 21, 2019 1:41 pm

rpdom wrote:
Mon Jan 21, 2019 12:49 pm
Is there a reason that simple replication can't work? For example, the same table in both databases gets updated independently and the changes need to be merged rather than just replicated from one system to the other. MariaDB (replaced MySQL a while back) can just about handle that. I had, until recently, been doing that for the last two and a half years with four servers being updated and replicating the updates to each other.
In this case I need raspberry pi a master and server as slave. In replication case slave connect to master. But I need that raspberry pi when go online connect to server and update database with new records. And as I know replication without internet connections got errors...

User avatar
rpdom
Posts: 22352
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Mirroring mysql

Mon Jan 21, 2019 3:54 pm

arvix wrote:
Mon Jan 21, 2019 1:41 pm
And as I know replication without internet connections got errors...
Usually warnings, but once connection is re-established the replication will resume and catch up.

arvix
Posts: 6
Joined: Wed May 04, 2016 12:26 pm

Re: Mirroring mysql

Tue Feb 12, 2019 10:18 pm

Ok. So if I understand write both (server and raspberry PI) must get real IP addresses. But how I can use replication if Raspberry Pi don't have real IP address? Real IP address is only on server... Raspberry pi will be connetted to internet via GSM board...

Return to “Networking and servers”