This section describes how to create a connection to a sample database.
The sample files you copied in the previous section include a sample Microsoft Access database file called tutorial.mdb. It also includes a SQL script called tutorial.sql that you can use to create a sample MySQL database. Because the Macintosh version of the ColdFusion server doesn't provide a native Microsoft Access database driver, Macintosh users can connect to the MySQL database. For instructions on creating the sample MySQL database, read my article, Setting up a PHP development environment for Dreamweaver, in the Dreamweaver Developer Center.
When developing a ColdFusion web application in Dreamweaver, you connect to a database by selecting a ColdFusion data source defined in ColdFusion Administrator, the server's management console.
A ColdFusion data source is a type of shortcut to a database. Dreamweaver uses the data source to create a connection to the database.
For information on connecting to other database systems, see Database connections for ColdFusion developers in Dreamweaver LiveDocs or Using Dreamweaver (Help > Dreamweaver Help).
Topics covered in this section:
If you are running ColdFusion on a Windows machine, you can create a data source that points to the sample Microsoft Access database.
Click the Browse Server button next to the Database File text box, and then locate and select the tutorial.mdb database.
Depending on where you copied the sample files in the previous section, the file should be located in the following folder:
\ColdFusion8\wwwroot\MyWebApp\data\tutorial.mdb
If you're running ColdFusion on a Macintosh, you can connect to a MySQL database instead of the Microsoft Access database. Before completing this procedure, you must install MySQL and then create a sample database. For instructions on creating a sample MySQL database, see Setting up a PHP development environment for Dreamweaver in the Dreamweaver Developer Center.
After installing MySQL and creating the sample database, create a ColdFusion data source that points to your sample database. Make sure the MySQL server is started before completing the following procedure.
Username: your MySQL username
Password: your MySQL password
For example, if your MySQL user name (also known as an account name) and password are Kensei and Te22y3, enter the following values:
Username: Kensei
Password: Te22y3
If you don't have a password, omit the password value as follows:
Username: Kensei
Password: <blank>
If you didn't define a user name while configuring your MySQL installation, enter root as the user name, as follows:
Username: root
Password: <blank>
The final step of the setup process is to create a connection to the database.
For ColdFusion applications, Dreamweaver creates the connection automatically for you. Open any ColdFusion page in the Cafe Townsend site in Dreamweaver, and then open the Databases panel (Window > Databases). Your ColdFusion data source should appear as a database connection in the panel.
If the connection does not appear, click the Refresh button on the Databases panel toolbar, complete the checklist in the panel, or consult Troubleshooting database connections in Dreamweaver LiveDocs or Using Dreamweaver (Help > Dreamweaver Help).
In the Databases panel, expand the connTownsend branch, and then expand the Tables branch. Three tables should appear as in Figure 10.

Figure 10. Expanded tables in the Databases panel.
If you want, you can now proceed to the Developing a web application tutorial in the Dreamweaver Developer Center. This follow-up tutorial uses the setup described in this tutorial to teach you how to display dynamic content on web pages. The tutorial also shows you how to create a form that saves visitor comments to the database.