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 8259763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:56:19+00:00 2026-06-08T02:56:19+00:00

Situation: our production mysql database makes a daily dump into a .sql file. I’d

  • 0

Situation: our production mysql database makes a daily dump into a .sql file. I’d like to keep a shadow database that is relatively up to date.
I know that to create a mysql database from a .sql file, one uses:

mysql -u USERNAME -p DATABASENAME < FILE.SQL

For our db, this took 4-5 hours. Needless to say, I’d like to cut that down, and I’m wondering if there’s a way to just update the db with what’s new/changed. On Day 2, is there a way to just update my shadow database with the new .sql file dumped from the production db?

  • 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-08T02:56:19+00:00Added an answer on June 8, 2026 at 2:56 am

    MySQL Replication is the way to go.

    But, in cases, where that is not possible, use the following procedure:

    Have a modifed timestamp column in all your tables and update this value whenever a row is inserted/changed.

    Use the following mysqldump options to take the incremental SQL file (this uses REPLACE commands instead of insertcommands, since the existing record will be updated in the backup database).

    Keep a timestamp value somewhere placed in the file system. and use it in the where condition. MDFD_DATE is the column name on which you need to filter. On successful backup, update the value stored in the file.

    skip-tz-utc prevents MSQL from automatically adjusting the timestamp values, based on your timezone.

    mysqldump –databases db1,db2 –user=user –password=password –no-create-info –no-tablespaces –replace –skip-tz-utc –lock-tables –add-locks –compact –where=MDFD_DATE>=’2012-06-13 23:09:42′ –log-error=dump_error.txt –result-file=result.sql

    Use the new sql file and run it in your server.

    Limitations:

    This method will not work if some records are deleted in your database. You need to manually delete them from the backup databases. Otherwise, keep a DEL_FLAG column and update it to ‘Y’ in production for deleted records and use this condition to delete records in the backup databases.

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

Sidebar

Related Questions

I have a situation where our developers extended a Third party database (MS SQL)
We've encountered the following situation in our database. We have table 'A' and table
I came across this situation while migrating our DB from Foxpro to SQL. Below
We have a db dump import script from our production db that we use
We have a situation where our application calls some stored procedures on a sql
In our production environment, weblogic server hangs for half an hour, It looks like
All of our production instances of reporting services are split into the web server
The situation is as follow : Our company works two main production sites, communicating
I'm having a problem with the knockout-mapping plugin with IE8. Our situation is that
Situation: I'm working with Adobe Livecycle ES2 and Flex In our project we show

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.