Solved

Moving mysql datadir to dropbox, tables in databases not showing

Posted on 2014-02-10
14
1,048 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
14 Comments
 
LVL 53

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 53

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
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 

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 53

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 53

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
 

Author Comment

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

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 53

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 53

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

This article discusses how to implement server side field validation and display customized error messages to the client.
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
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 a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

724 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