Mysqlrowcopy creates insert statements by extracting data from result sets, providing a useful tool for generating SQL commands.
To build mysqlrowcopy, you have to run the command, " ./ configure make." Once this is done, mysqlrowcopy and mysqlrowcopy.debug files will be created. They both offer the same functionality, with the only difference being that the .debug file includes debugging symbols built for (gdb). As mysqlrowcopy's usage is tied mainly to I/O, the necessity of a 64-bit version is to work against any potential issues that may arise in dynamic linking 32-bit binaries.
One of the ways to use it is for Migrating a MySQL user account from a QA server to a production server. All you have to do is open the command prompt and input the following command:
$ mysqlrowcopy -h qa3.example.com 'SELECT * FROM db WHERE User = "reaper"' mysql db > reaper.sql.
Then on the production server, run the command:
$ mysql -h prod1.example.com mysql < reaper.sql.
Alternatively, you can pipe the output of mysqlrowcopy into mysql and avoid the intermediate file.
Another way to use it is by keeping the test environment up to date with the most recent production data. Achieving this can be accomplished by running this sequence once a day from the cron:
$ mysqlrowcopy -h finance-db.example.com 'SELECT * FROM stocks WHERE modified > DATE_SUB(NOW(),INTERVAL 24 HOUR)' finance stocks > day-stocks.sql.
Then run cat day-stocks.sql | mysql -h finance-test.example.com finance.
mysqlcowcopy can be used to transfer data between tables on diverse servers with some similar fields. For instance, you might have common data in table Zip on a production database, and table ZipPosition in a research database. To load data from production 'Zip' into research 'ZipPosition', you can run:
$ mysqlrowcopy -h production 'SELECT ZIPCode,Latitude,Longitude' common ZipPosition > pos.sql $ cat pos.sql | mysql -h qa research.
Overall, Mysqlrowcopy is a powerful tool that simplifies inserting statements from produced results, and its features make data management more manageable between QA and production.
Version 1.0: N/A