beautypg.com

Database connections for php developers – Adobe Dreamweaver CC 2014 v.13 User Manual

Page 609

background image

Database connections for PHP developers

To the top

To the top

To the top

About PHP database connections
Connect to a database
Edit or delete a database connection

Note: The user interface has been simplified in Dreamweaver CC and later. As a result, you may not find some of the options described in this
article in Dreamweaver CC and later. For more information, see

this article

.

About PHP database connections

For PHP development, Dreamweaver only supports the MySQL database system. Other database systems such as Microsoft Access or Oracle
are not supported. MySQL is open-source software you can download for free from the Internet for non-commercial use. For more information, see
the MySQL website at

http://dev.mysql.com/downloads/

.

This section assumes you have set up a PHP application. It also assumes a MySQL database is set up on your local computer or on a system to
which you have network or FTP access.

For development purposes, download and install the Windows Essentials version of the MySQL database server.

Connect to a database

To connect to a database when developing a PHP application in Dreamweaver, you must have one or more MySQL databases and the MySQL
server must be started.

1. Open a PHP page in Dreamweaver, and then open the Databases panel (Window > Databases).

2. Click the Plus (+) button on the panel, select MySQL Connection from the menu, and complete the dialog box.

Enter a name for the new connection, without spaces or special characters.

In the MySQL Server box, enter an IP address or a server name for the computer hosting MySQL. If MySQL is running on the same
computer as PHP, you can enter localhost.

Enter your MySQL user name and password.

In the Database box, enter the name of the database, or click Select and select the database from the list of MySQL databases, and
click Test.

Dreamweaver attempts to connect to the database. If the connection fails, double-check the server name, user name, and password. If the
connection still fails, check the settings for the testing folder Dreamweaver uses to process dynamic pages.

Dreamweaver makes a best guess at auto-populating the value for the URL prefix in the Testing Server category of the Site Definition dialog
box, but sometimes you will have to adjust the URL prefix to get your connection to work. Make sure that the URL prefix is the URL that
users type in their browsers to open the web application, minus the file name (or start page) of the application.

3. Click OK.

Note: If you encounter the error message “Client does not support authentication protocol requested. Consider upgrading MySQL client”
when testing a PHP database connection to MySQL 4.1, see Troubleshooting MySQL error messages.

Edit or delete a database connection

When you create a database connection, Dreamweaver stores the connection information in an include file in the Connections subfolder in the
site’s local root folder. You can edit or delete the connection information in the file manually or as follows.

Edit a connection

1. Open a PHP page in Dreamweaver, and then open the Databases panel (Window > Databases).

2. Right-click (Windows) or Control-click (Macintosh) the connection and select Edit Connection from the menu.

3. Edit the connection information and click OK.

Dreamweaver updates the include file, which updates all the pages in the site that use the connection.

Delete a connection

602

This manual is related to the following products: