Giter Club home page Giter Club logo

mysql-db-sync's Introduction

20100821 Xavier Snark [email protected]

This is taken from the usage statement. Please refer to the usage statement for the 
most comprehensive and up to date information.


A simple, limited shell script for synchronizing MySQL databases between servers.
This script uses my.cnf defaults files for managing the migration of data between the source
and destination databases. An example defaults file mmay contain:

	[client]
	host=your_db_hostname
	database=my_database
	user=my_username
	password="my_secret_passord"

To use, create two of these files, one for the source database
(perhaps named "source_db_config") and one for the destination (perhaps named "dest_db_config").
Call this script with these config files as arguments, for example:

	$0 -v -n -s source_db_config -d dest_db_config

Note this command would operate in dry-run mode and not actually perform any operations.

Required Arguments:
-s or --source-config my.cnf-file
-d or --destination-config my.cnf-file
	This is to specify a source and destination my.cnf file. This must be used to pass username,
	password, host, and database settings for accessing the servers.
Optional Arguments
-o
--dump-database
	This specifies the specific database name to dump from the source host. (mysqldump will NOT use
	database specification in the config files, at least not that I've been able to determine. It
	must have database names passed on the command line.)
	If this is omitted, the script will attempt to determine the database for the source database
	by connecting to the source and issuing a select DATABASE() and then capturing the output.
	This argument only affects the SOURCE database, the destination will be the database configured
	in the destination defaults file.
-v
--verbose
	Spew a lot of messages about what's happening.
-l
--verbose-mysql
	Run MySQL commands in verbose mode. (Mnemonic: "loud"; Independent of -v argument)
-n
--dry-run
	Don't perform the cleaning, dump, or import operations.
	

mysql-db-sync's People

Contributors

xssnark avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.