Dreamweaver - PHP/MySQL Configuration
This article will help you configure a PHP and MySQL testing server in Dreamweaver.
READ ME FIRST
(mt) Media Temple does not support third-party software. This Dreamweaver tutorial is provided as a courtesy. For information on Dreamweaver, please see: adobe.com/products/dreamweaver.html.
Before you start, you must already have a database, username, and password set up on your server. For more information, please see:
- First, create a "Site" to hold your files. When creating the site, be sure to specify that you want to use the "PHP MySQL" server technology.
- Set up a "Testing Server" using the same information as the remote server. The Server Model should be set to "PHP MySQL," and the Access menu should be set to "FTP." See the link to the FTP article above for more information on FTP in Dreamweaver.
- Create a new PHP file in the site by selecting "Site" in the Site tab of the Files panel. Then press Ctrl+Shift+N.
- Change the new file's name from untitled.php to something that makes sense to you. Then, double-click the file to open it. This file MUST be PHP, or you will not be able to access the database.
- Now, it's time to set up a database connection. Click the "Databases" tab of the Application panel, and then the + button. Alternatively, from the Window menu, select Databases.
- In the MySQL Connection dialog box, fill in the following information:
- MySQL Server: The database server host name. Your database server host name is internal-db.s00000.gridserver.com, where 00000 is your site number.By default, this is "localhost," which will work on the DV server as-is.
- Username: Your database username, which should be of the form db00000_useras configured in Plesk.
- Password: Your database password.
- Database: Your database name. This should look like db00000_dbname.
Click the Test button in the dialog box to make sure that the information you've entered works correctly.
See this article for additional Grid connection information: Why can't I connect to my MySQL database from PHP?
There is a known bug in Dreamweaver that does not allow for automatic table name discovery in databases with hyphens in the name, so this may affect you if your databases include a hyphen. The workaround is to manually specify table names in queries. Once the name is specified, Dreamweaver is able to query such databases.