2

I would like to source control some MySQL procedures hosted in Amazon RDS with Git.

As far as I know, it is not possible to access via ssh to a RDS instance and run commands like git pull or git push. So my question is, how do you version control the scripts using Git?

Edit: Finally, I've found a workaround based on the thread proposed by Patrick Steele in the comments.

As my situation only required to source control procedures in Mysql (not any other data), I've written a shell script with the following code:

#!/bin/bash

mysqldump --user=user --password=password --host=instance-rds --routines --no-create-info --no-data --no-create-db --skip-opt database_name > 'path_to_repository/sql/dump/dump.sql'
cd path_to_repository
git add sql/dump/dump.sql
git commit -m "Updated sql procedures in RDS instance" 
git push origin master

This script will synchronize any change made within the database with the repository.

1

0

Browse other questions tagged or ask your own question.