• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1078
  • Last Modified:

Moving mysql datadir to dropbox, tables in databases not showing

Hi,

I edited the mysql datadir in the my.cnf configuration file in c:\Xampp\mysql\bin\my.cnf to a different location.

I moved the datadir location to my dropbox folder to have the same databases on multiple computers, but some of the database now have no tables in them, on computer(s) they were not created on (although the folders of the database do contain the database table files).

new datadir="C:/Dropbox/Websites/_databases"

It doesn't matter is the db is innodb or myisam i believe, both types either have all the table showing or none.

What is causing this?
What can i do to make this work? ("syncing the databases through dropbox"?)

Thanks!
0
peps03
Asked:
peps03
  • 7
  • 7
1 Solution
 
Scott Fell, EE MVEDeveloperCommented:
It sounds like they are not synced.  The first sync takes the longest.  Check the size of the file for each computer.  That should give you a clue if they are synced.  Double check syncing is on for each computer as well.
0
 
peps03Author Commented:
Thanks for your reply.
Maybe i'm not 'syncing' correctly. I'm just syncing the data directory via dropbox, but it works for some databases, not for others.

I checked a database that works on computer 1, where is was created.
The db folder is also on computer 2, all files and sizes match.
5x .frm and 1x db.opt - files
Which seems correct as well, the db consists of 5 tables.

Only on the second computer the database has no tables, but the database itself is visible.

What to do?
Thanks!
0
 
Scott Fell, EE MVEDeveloperCommented:
Try throwing another test file in that dropbox folder and see if the other computer is getting it.  

I use dropbox for most of my development but not for a database.  I suppose if you are just using it for developing it would be fine.   If you have an active db in a dropbox and dropbox is continually syncing, I think that is going to end up bad.

Why are you using dropbox for this?  Just throw your db on a cheap shared hosting.  This is only $5 bucks a month https://www.digitalocean.com/pricing.  At one time newtek had $3 hosting just for development http://webservices.thesba.com/linux-web-hosting/ 

I just would not trust a database in something like dropbox or google drive.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
peps03Author Commented:
Yes, it is getting the files transferred.

I don't know if dropbox syncing will be a big problem. 99% of the time only 1 of the computer is on, when syncing, the other will be off.

Is it possible to use an online database (in a hosting package) and local web-server for development?

I have my own vps, but i don't want to work online as the uploading of files will drive me crazy.

And i believe dropbox sync of databases should work, just need to know how.

Is their a way to rebuild the db or something? as the files are there...

thanks!
0
 
Scott Fell, EE MVEDeveloperCommented:
It would be better if no computers were syncing.  Everytime you update/add/delete from the database or even if the db creates logs, syncing will kick in.  That could be many times per minute.  I don't know enough to give you a firm answer but that does not seem like a good answer.  

If you just want to develop locally, use localhost on your computer or MAMP/WAMP.
0
 
peps03Author Commented:
If you just want to develop locally, use localhost on your computer or MAMP/WAMP...

Yes, i'm using xampp, i think its similar, but i develop on multiple computers.. thats the problem.
0
 
Scott Fell, EE MVEDeveloperCommented:
I develop everything on dropbox myself.  It is great because it auto syncs with multiple computers plus it is an easy version control (go to dropbox.com and you can view every save of your document you ever did.  If you are on paid it is forever, if free, just 30 days history).

But for my database, I use my server when it is windows/mssql server and for mysql/php, I push out from my local dropbox to my local site where the folder my localhost is located.    I don't have a db on my dropbox drive.  

I also have an external drive for back  up and that gets the stuff dropbox does not.

I have been using the free local version of bitnami http://bitnami.com/
0
 
peps03Author Commented:
is it possible to use localhost on computer and online database?
0
 
Scott Fell, EE MVEDeveloperCommented:
Yes, that is a common way to develop where the test db is localhost and the live is online.  It should be a matter of switching out your connection string live vs localhost.  I have scripted to detect the domain in my connection string so it automatically uses the live db when online vs the testing db. That avoids the oops of overwriting your connection string file.
0
 
peps03Author Commented:
yes, i have that too,.

what i meant is scripting local, and both local and online database "online".
0
 
Scott Fell, EE MVEDeveloperCommented:
I am still not sure what you are asking.  Do you mean if you can script locally for the online database like you do with the local?

That will depend on your hosting.  If you are on a shared host, you are at their mercy and the default is typically you can access the db from outside.  If you have a dedicated or vps you can control this.  On my production database, I don't allow connections from the outside and only from localhost(on the server).  It is common practice to have both a testing db that you can access and a production db that you can't connect to from the outside.
0
 
peps03Author Commented:
I have a vps.

how do i set a db to accept access from outside?
that seems the best solution..
0
 
Scott Fell, EE MVEDeveloperCommented:
That would be a server routing/firewall issue.  Since this thread is on topic for using dropbox as a database host, close this question out and open a new thread for accessing your db from the outside.   Make sure to specify if you are using windows or linux and which version.

I can tell you it is best to allow access from an outside url only for testing and not production.

Good Luck
0
 
peps03Author Commented:
Thank you for the help!!!
I'll open a new question.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

  • 7
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now