I have been using Google Backup and Sync for some time but I just decided it would be nice if I could use it for properly syncing so that data on all my Windows machines could essentially be the same, i.e. all use the same Gmail account Drive.
Everything has been working nicely. But today I tackled the files used by MySQL (in fact MariaDB MySQL fork).
If I modify some data on one machine (machine "A"), several files get changed: ibdata1, ib_logfile0 and ib_logfile1. These then get mirrored to the Cloud location (i.e. GDrive remote site). Unfortunately, these 3 files (and a couple of other MySQL files) don't then replace the existing files on machine B.
When I look at the reason why GB&S is saying "can't sync" for these files on machine B it says "You don't have permission to sync these files".
I take this to mean because the MySQL service is being run by the owner SYSTEM.
I've tried a couple of times to understand how Windows file ownership and permissions work in reality (it seems to be different to some of the explanations out there). But is there a quick or not-so-quick fix for this problem?
A few more details
Looking at the existing ibdata1 file on machine B (where the incoming replacement of this file is not being allowed to replace it), I find that in fact the owner is said to me "M17A/Mike", where M17A is the name of the computer.
Under the "Security" tab for the file, there are four entries under "Group or user names": Authenticated Users, SYSTEM, Administrators (M17A\Administrators) and Users (M17A\Users). All 4 of these have "Full control" ticked (I set this myself earlier today trying to solve this problem).
Rather than ownership/control, could it be something to do with the fact that the MySQL service has these files under its control as long as it is operating? Again is there any solution to this?
PS there's another problem with this, which is the size of these MySQL files: a tiny modification to one record in one dbase triggers the uploading of over 100 MB of files (the 3 main files mentioned above) by GB&S, followed by the downloading of them to sync the other computers attached to the same account. But this is a separate and less urgent problem.
The googledrivesync.exe
executable runs as the user who starts the application. This would typically be the user currently signed in to the computer. This means your user accounts needs to have full control permissions on any files / folders you want Google Backup and Sync to access. Best practice would be to make sure that full control permissions are granted to your user account on the google drive folder and those permissions are propagated to all subfolders and files.
Rather than ownership/control, could it be something to do with the fact that the MySQL service has these files under its control as long as it is operating? Again is there any solution to this?
Yes. This is why Google Backup and Sync cannot modify the file. This is not a Google Backup and Sync limitation. This is a limitation (or rather a protection) in the operating system that prevents one process from modifying a file that is open in another process.
There is not a solution for that.
Unfortunately, you're running in to problems with all cloud sync tools and to a greater extent the problem of file sharing in general. You're trying to use it to sync an in-use database file. Even if the application that is accessing the file is designed in such a way that multiple processes can share the file, it still wouldn't work well with a cloud sync tool. You are not working with live data on cloud synced folders. Instead, one machine modifies the file and the changes are uploaded to the cloud, then the second machine recognizes the changes and downloads the file. There is lag, and no guarantee that both machines will always have a reliable internet connection. There is no mechanism to insuring the integrity between these file level changes. The two machines are never accessing the "same" file as is the case with an application that may be designed to work together with multiple users on the same local network.
For that reason, use Google Backup and Sync to sync files that a have a low likelihood of being used by multiple machines at the same time.
A work around in your situation would be to setup a manual process where Machine A backs up the MySQL database to a file and then allow that file to sync to Machine B. Then, Machine B restores that backup file to the MySQL database on Machine B. Perform this process when you want to "refresh" the data on Machine B.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments