Solved

Moving mysql datadir to dropbox, tables in databases not showing

Posted on 2014-02-10
14
1,010 Views
Last Modified: 2014-02-14
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
Comment
Question by:peps03
  • 7
  • 7
14 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39848808
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
 

Author Comment

by:peps03
ID: 39849559
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
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39849723
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
 

Author Comment

by:peps03
ID: 39850251
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
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39850531
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
 

Author Comment

by:peps03
ID: 39851227
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
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39851442
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
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 

Author Comment

by:peps03
ID: 39851486
is it possible to use localhost on computer and online database?
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39851588
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
 

Author Comment

by:peps03
ID: 39851657
yes, i have that too,.

what i meant is scripting local, and both local and online database "online".
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39852187
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
 

Author Comment

by:peps03
ID: 39853199
I have a vps.

how do i set a db to accept access from outside?
that seems the best solution..
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39853888
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
 

Author Closing Comment

by:peps03
ID: 39859218
Thank you for the help!!!
I'll open a new question.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now