Once you are convinced of the validity of your data, you can move
the tables to your production server. We'll do that by first using
the mysqldump utility. To export only the final
versions of the tables, go to the command line and type:
shell> mysqldump -u username -p --databases association > newdb.sql
You can open a MySQL console window from within Query Browser. Find this option under the Tools menu.
The mysqldump utility takes many of the same
switches as the MySQL client; as you can see, you specify your
user name and password in the same way. You also need to specify
the database name you wish to dump. In this case, the output is
redirected to a script file named newdb.sql. If
you do not wish to create a database and only want to dump the
tables in the association database, execute the
preceding command without the --databases option.
For more information about the many options available with
mysqldump see
http://dev.mysql.com/doc/5.0/en/mysqldump.html.
Have a look at the contents of the script file so that you understand what it does. Any existing tables with the specified table names will be dropped and recreated and then the data will be inserted. If you are overwriting existing data, you may want to back up your data before running the script file.
How you execute the dump script file depends upon how you access your production MySQL server. If you have direct access to the server or access through ssh, transfer the script file to the machine hosting the server, and then issue the command:
shell> mysql -u username -p < newdb.sql
If you saved only the database tables, you must specify a database when issuing the preceding command.
If you have remote access to your production server simply add the
-h hostname option to
the preceding command. You may also upload your script using an
application such as phpMyAdmin. Finally, you can open and execute
the script file from within Query Browser — but more about
this in the next section.
