Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7887113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:29:43+00:00 2026-06-03T05:29:43+00:00

I set up MAMP on my machine to develop some website stuff, and since

  • 0

I set up MAMP on my machine to develop some website stuff, and since I wanted to separate out my projects in an organized manner I set up virtual hosts for each one, which is working. I have my web files (javascripts, css, html, php ) for each project in a directory such as /Users/Alex/Dropbox/code/projectX/. My MAMP directory is otherwise identical to how it was out-of-the-box; all Mysql stuff is in /Applications/MAMP/db. \projectX\ is already a git repository, but my db files are not version controlled.

Question: how do I version control the database associated with each web project? I have three approaches in my head, and am not sure how implement the first two. I prefer the first one because it seems simpler and fits in with the virtual hosts scheme nicely.

a) Move the database directory for projectX into \projectX\ folder and then just git add it. I do not know how to tell MySQL that I have this database here and that database there, though.

b) Somehow tell git that it also needs to version control Applications\MAMP\db\mysql\projectXdb as if it were inside \projectX\

c) Don’t be fancy and just have a separate repository for the databases.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:29:45+00:00Added an answer on June 3, 2026 at 5:29 am

    First, I would read this and the links he posts to — simply because they are a good read.

    In short (and this is where I may be misunderstanding the question), I don’t think it’s ever the wisest to store the actual database into version control ever. Rather, you will need to decide on some system of storing database scripts which control/alter/set the database. Thus, these scripts can be stored absolutely anywhere within your code’s file structure.

    If this idea works, then you don’t have to change the location of the actual database, and git doesn’t have to care where the actual database is either.

    An example of what I’m suggesting would be to make a file like this:

    ALTER TABLE Customer
      ADD ShoeSize int NOT NULL DEFAULT 0
    GO
    
    INSERT INTO OrderStates 
       (OrderStateID, OrderState)
       VALUES(3, 'Cancelled')
    GO
    

    And then store that into some directory called /Users/Alex/Dropbox/code/projectX/db-scripts or something. Within that directory would be all the scripts needed to manage/replicate your DB at any moment.

    EDIT:

    If the software keeps all information in the DB itself, then perhaps run mysqldump (or equivilant) and store that script into the code.

    Storing the textual version allows two things:

    a) It’s more effective/efficient than storing binary files (if I understand RCS/git correctly)

    b) git can do diffs and grep-searches on the files. (Which might not matter if there is already another tool doing that)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to set my RewriteLogLevel in MAMP to figure out some mod_rewrite problems.
UPDATE: I've got MAMP Pro. Should I simply set-up another virtual host on my
I am using MAMP. Basically, to use the website before, I would go to
I'm trying to setup a virtual directory in Apache on MAMP. This is what
I tried to download and set up MAMP on my Mac. When I went
I have MAMP set up on my iMac and on my Macbook. I want
I'm trying to set up 'cake bake' on OS X. I'm using MAMP and
I'm building a website using MAMP on OS10 Leopard . I'd like to be
I'm using MAMP to host my Joomla website on my Macbook. I've been developing
I'm working on a wordpress website and I'm attempting to set up a local

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.