2010-08-16
QPL Reference Manual

The mysqldump program that comes with MySQL can be used to export the project data from the web site. Usually, you will use this program to build an SQL script file, that contains all the table definitions and data, and then use the script file to rebuild the data base on another computer.

This program must be run by the web server administrator to get the data from a data base on your web server.

Dumping Data

The sample command lines below show how you might use this program with a QPL project.

Examples

Dump all of the tables and data.

%> mysqldump -p -u username databasename > backup.sql

Dump only the data table for non-test account cases.

%> mysqldump -p -u username -w "q_uname NOT LIKE 'test%'" databasename data > backup.sql

Change the user, data base, and back up file names to the names used in your project.

Reloading Dumped Data

When loading the SQL script generated by mysqldump, you must first create a data base to hold the tables and data. The following example shows how this may be done from the MySQL command line. The mysqldump script will create the tables within this data base and load the data. (The data base name here must be the same as the web site data base name if you intend to run the QPL project programs with it on the new computer. Otherwise, you can use any name.)

mysql> CREATE DATABASE databasename;
mysql> USE databasename;
mysql> SOURCE backup.sql;

Once it is reloaded, you may run SQL queries on the data.