Migrating spreadsheet data to a MySQL database can be a relatively simple task especially when using Query Browser. However, migrating users to that database can be much more difficult. You may find that you continue to receive database updates in the form of complete but modified spreadsheets.
It may seem counterintuitive, but such updates can be handled most easily by recreating the entire database again. If we script this process then updates can be done in a matter of seconds. All we need are a few modifications to the script file that we saved as we worked.
The only additions to this script are DROP
TABLE statements — making it much easier to reuse
the database that's already there. This script can be run from the
command line as described in the previous section or you can open
it within Query Browser.
To open a script file from within Query Browser choose the Open Script option under the File menu. Find the script file and select it. A script file tab will open showing the contents of the file. Syntax highlighting is one of the advantages of executing a script from within Query Browser — errors are much more easily spotted. Any errors that occur during execution are displayed in a pop-up dialog, specifying the nature of the error and also the line number. You can also set break points and step through the code one line at a time if you wish.
Using Query Browser made it easy to document our actions in migrating a spreadsheet to MySQL. This documentation is easily turned into a script file so that we can recreate the process. It can also serve as a reference for techniques to use in future migrations. Find a copy of the script file in the next section.
