简体   繁体   中英

How to update mysql database changes on database server automatically?

Client want that database structure update should be automatic and error free.

For Example:

  • DeveloperA added new SQL query 1 to central place.
  • DeveloperB added new SQL query 2 to central place.
  • Cronjob runs at night and SQL query 1 and SQL query 2 is updated on database server.
  • Developer added new SQL query 3 to central place.
  • Cronjob runs at next night and SQL query 3 is updated on database server.

Is it possible or at what level we can automate this update process?

What is the best standard uproach to update database changes daily when there are many developers working on a project and adding SQL scripts to database?

We are using:

Linux dedicated server.
Crontab
PHP
MySQL
SVN
Shell Scripting

I would set up three directories;

  • pending
  • success
  • failure

New scripts are dropped into "pending". A process runs from cron and picks these up, and tries to process them. Successfully processed files are moved to "success", otherwise they are moved to "failure".

A log file records all activity by the scheduled process, and emails or alerts are generated upon failure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM