Creating a database connection

Creating a database connection

The final step of the setup process is to create a connection to the database.

To create a database connection in Dreamweaver:

  1. Open any PHP page in Dreamweaver and then open the Databases panel (Window > Databases).
  2. Click the Plus (+) button on the panel and select MySQL Connection from the pop-up menu.

    The MySQL Connection dialog box appears,

  3. Enter connTownsend as the connection name.
  4. In the MySQL Server text box, specify the computer hosting MySQL.

    Enter an IP address or a server name. If MySQL is running on the same computer as Dreamweaver, enter localhost.

  5. Enter your MySQL user name and password.

    If you didn’t define a user name while configuring your MySQL installation, enter root in the Username text box. If you don’t have a password, leave the Password text box blank.

  6. In the Database text box, enter CafeTownsend.

    CafeTownsend is the name of the sample MySQL database you created (see Creating the MySQL database).

  7. Click Test.

    Dreamweaver attempts to connect to the database. If the connection fails, do the following:

    • Double-check the server name, user name, and password.
    • Check the settings for the folder Dreamweaver uses to process dynamic pages (see Specifying where dynamic pages can be processed (PHP)).
    • Consult Troubleshooting Database Connections in Using Dreamweaver (Help > Using Dreamweaver).
  8. Click OK.

    The new connection appears in the Databases panel.

The sample PHP application is now set up for the tutorials in Getting Started with Dreamweaver. For more information, see Tutorial: Developing a Web Application.

Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Adding Content to Pages
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly