Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

How to use one MYSQL datadir on 2 raspberry's?

Wed Apr 08, 2015 8:04 pm

Hello I like to use one datadir of MYSQL on 2 raspberry's.

I did mount 2 directory's on both raspberry's.
I tried to put the datadir of MYSQL in one off the mounts by the way mentioned in this link:
http://gagsap37.blogspot.nl/2014/11/ras ... -data.html

After doing this the mysql server is not starting anymore.
The basic idea is to copy the mysql datadir to a mounted directory and change in both raspberry's /etc/mysql/my.cnf files the datadir to the mounted directory with the copied datadir in it.

Will this work?
Why is the mysql server not starting more after doing exactly as mentioned in the link?
Can it be something tod do with the rights of the new copied directory?

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to use one MYSQL datadir on 2 raspberry's?

Thu Apr 09, 2015 1:08 am

You can't do that. MySQL does not support filesharing. Make one RPi a server, make the other a client with remote access to the MySQL server. Or make both RPis servers and use table level replication to ensure updates on one system are propagated to the other.

https://dev.mysql.com/doc/refman/5.1/en ... howto.html
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

Re: How to use one MYSQL datadir on 2 raspberry's?

Thu Apr 09, 2015 7:54 am

DougieLawson wrote:You can't do that. MySQL does not support filesharing. Make one RPi a server, make the other a client with remote access to the MySQL server. Or make both RPis servers and use table level replication to ensure updates on one system are propagated to the other.

https://dev.mysql.com/doc/refman/5.1/en ... howto.html
Thank you for this answer again.

Because English is not my native language I do have trouble understanding everything in detail.

I do understand how to create a master and client in MYSQL reading the howto.
I do have more difficulty understanding how to synchronize the databases.
Beside that I don't understand How the both Raspberry's are approachable by MYSQL. Because I don't see something to do with IP addresses?? How does MYSQL from Raspberry one know where the database of Raspberry two is?

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to use one MYSQL datadir on 2 raspberry's?

Thu Apr 09, 2015 9:42 am

What's your native language? We have forums on here for non-English speakers.
http://www.raspberrypi.org/forums/viewforum.php?f=90
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Canedje
Posts: 265
Joined: Thu Mar 26, 2015 7:18 am

Re: How to use one MYSQL datadir on 2 raspberry's?

Thu Apr 09, 2015 11:10 am

DougieLawson wrote:What's your native language? We have forums on here for non-English speakers.
http://www.raspberrypi.org/forums/viewforum.php?f=90
My native language is Dutch.
I do see an subforum over there.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to use one MYSQL datadir on 2 raspberry's?

Thu Apr 09, 2015 3:08 pm

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Troubleshooting”