Obtaining the sampdb Sample Database Distribution

The sampdb distribution contains the files that are used to set up and access the sampdb sample database. It is available at the following address:


The sampdb distribution is available as either a compressed tar file or as a ZIP file. To unpack a distribution in tar format, use one of the following commands (use the second command if your version of tar doesn't understand the z option):

% tar zxf sampdb.tar.gz 
% gunzip < sampdb.tar.gz | tar xf -

To unpack a ZIP-format distribution, use a utility such as WinZip, pkunzip, or unzip.

When you unpack the distribution, it will create a directory named sampdb that contains several files and subdirectories:

  • A README file containing additional general instructions for using the distribution. This is the first file you should read. Individual subdirectories of the distribution may also contain README files with more specific information.

  • Files for creating and loading the sampdb database. These are used in Chapter 1, "Getting Started with MySQL and SQL."

  • A capi directory containing the C programs from Chapter 6, "The MySQL C API."

  • A perlapi directory containing the Perl DBI scripts from Chapter 7, "The Perl DBI API."

  • A phpapi directory containing the PHP scripts from Chapter 8, "The PHP API."

The sampdb directory also will include a few other directories containing files that are referenced at various other points in the book.