Using MacOS X, Apache, PHP, MySQL, Dreamweaver UltraDev, and Phakt

•  Introduction
•  Choosing your Mac OS X Operating System
•  Installing Apache and PHP
•  Installing MySQL
•  Installing the required JDBC drivers
•  Installing the Phakt PHP Server Model
•  Setting up UltraDev and Phakt to talk to MySQL
•  Potential Problems







Page 6 -- Setting Up UltraDev to Talk to MySQL

Once you have PHP setup on your Web server, MySQL installed, and your JDBC drivers installed, it's time to talk to the database. When you create a PHP server model in your Site Definitions (refer to your UltraDev documentation for information on creating site definitions), you'll need to create a connection to your database before you can create recordsets.

For the Mac types: If you are developing with UltraDev and serving web pages from the same machine, OS X must be running for this to work. If you are running UltraDev in native OS 9.x, this won't work since Apache, PHP, and MySQL run under OS X. Boot you Mac into OS X, and run UltraDev in Classic mode.

The process is the same regardless of whether you're on a Mac or a PC. The screen will just look a little bit different between the two platforms.

In the example above, I've create a connection called "cnMySQL" that will be used on my PHP pages. In the following example, I've used the "mysql" database file that is created automatically for you when you run the installation script when installing MySQL. It contains users, passwords, and other database-related permissions.

In the UltraDev Connections section:

  1. I've picked the MySQL database type. This should automatically prompt for a JDBC URL.
  2. The host name is the address of the computer that the MySQL database resides on.
  3. The URL is the method by which UltraDev itself will speak with the database. The URL essentially says, "I will be using the 'mysql' database driver (the one installed earlier) via JDBC to speak with the 'mysql' data file residing at 192.168.1.5." The database name that resides at the end of the URL could be any database that is on your MySQL server.
  4. The User Name and Password are used to access the database. This user must have permission to view the database specified in the step above. Refer to the MySQL documentation or your favorite MySQL book for information about setting user permissions.

    Note to Mac Users: Selecting the "Check" button will result in a "No suitable JDBC Driver Found" error being generated. I haven't yet figured out what causes this error, but it does not affect UltraDev's ability to communicate with the MySQL database.

In the PHP Connections section:

  1. I've picked the MySQL database type.
  2. The host name is the address of the computer that the MySQL database resides on.
  3. The User Name and Password are used to access the database. This user must have permission to view the database specified in the step above. Refer to the MySQL documentation or your favorite MySQL book for information about setting user permissions.

    NOTE: There is no JDBC connection information in the second section of the connections dialogue. PHP has native MySQL drivers that it uses to access the database. The JDBC drivers are used only to allow UltraDev to speak with the database for things like Live Data Preview, Data Binding Inspector, etc.

Possible Problems

 

 
Copyright ©2001 Christopher Owens. The logos above are copyrighted by their respective owners, organization, and corporations.