SummaryA python script used to copy a MySQL database (including all relevant privileges) from one host to another, used as a wrapper around mysql and mysqldump.
For a full run down of usage instructions and options, run: mysql_copy_database -h
To test the script without making any changes, run: mysql_copy_database --dry-run
The script works roughly as follows:
You'll be prompted for source/destination host information, and the name of the DB to copy mysqldump will be used to dump the database to a temporary file The dumped database is re-created on the destination host The script will search for grants that appear relevant to the database on the source host You'll be prompted to apply each grant to the destination host
And that's it!
It's currently been tested on various linux and solaris systems, with MySQL versions 4 and 5.
To change any of the basic configuration settings, just edit them within the Settings class at the top of the file. All options should be documented within it.
Any comments/suggestions/feature requests are more than welcome.
RequirementsSoftwareMySQL client The script uses the mysql and mysqldump binaries, and looks for them in /usr/bin unless an alternative location is specified in the script's settings.
Python ModulesThe follow python modules are used by the script:
Use Patent Claims
Include Install Instructions
These details are provided for information only. No information here is legal advice and should not be used as such.