The instructions on this page apply only if you decide to use IIS as your web server on Windows or if you use the preinstalled versions of Apache and PHP on Mac OS X. If you installed XAMPP or MAMP, skip to the next page where you'll learn how to define a PHP site in Dreamweaver.
This section covers the following topics:
Note: The current version of PHP (5.2.8) does not support MySQL 5.1. You must install MySQL 5.0.
This section describes how to download and install the MySQL 5.0 Community Edition database server on your Windows computer.
Note: The instructions in this section apply to the "Windows Essentials" installer for MySQL 5.0. For other versions, please see the MySQL documentation for possible differences in the installation procedure. You need to be logged into Windows in an Administrator account. In Windows Vista, it is advisable to disable User Access Control (UAC) temporarily during installation.
Download the Windows Essentials installer from the Windows Downloads category on the MySQL download page:
http://dev.mysql.com/downloads/mysql/5.0.html#win32
You'll find different versions for 32-bit and 64-bit systems. The correct version for 32-bit Windows is Windows Essentials (x86).
Double-click the MSI file you downloaded and follow the onscreen instructions.
Note: Select Typical Install when prompted.
When the setup wizard is done, select the Configure the MySQL Server Now option on the setup wizard's last page and click Finish to run the configuration wizard.
Note: If you missed the option in the setup wizard, you can open the configuration wizard by selecting Start > All Programs > MySQL > MySQL Server 5.x > MySQL Server Instance Config Wizard.
The next step is to install phpMyAdmin, a graphical front end for MySQL. The instructions follow the next section, which shows Mac users how to install MySQL.
This section describes how to download and install the MySQL 5.0 Community Edition database server on your Mac.
Note: The instructions in this section apply to the package format (DMG) installer of MySQL 5.0 for the Mac. For other versions, refer to the readme file that comes with the installer for possible differences in the installation procedure.
Download an installer package from the "Mac OS X (package format) downloads" category on the MySQL download page:
http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg
Be sure you select the correct version for your operating system and processor. If your Mac has an Intel processor, select the package marked "x86."
Double-click the mysql-standard-x.x-x.pkg file and follow the onscreen instructions.
Note: If you have an Intel Mac, you may see the following error message in the destination disk selection dialog box: "You cannot install this software on this disk. (null)." If this error occurs, click the Go Back button once to return to the previous screen, and then click Continue to advance to the dialog box again. You should now be able to choose the destination disk.
After the installation of the database server is complete, install a button to start and stop the database server by double-clicking the MySQL.prefPane file in the installation disk image, and then follow the onscreen instructions.
This small installer places a stop and start button in your system preferences to control the server. The button can be accessed through a new MySQL icon under the Other category in the System Preferences dialog box.
Close the MySQL preference pane.
A new installation of MySQL is not password-protected, so you need to set a password for the administrative superuser called root.
Enter or paste the following instruction at the command prompt: /usr/local/mysql/bin/mysql -uroot
The MySQL command prompt appears:
mysql>
Switch to the main database that contains details of user accounts and privileges by typing use mysql; followed by Return.
Note: All commands typed at the MySQL command prompt must end with a semicolon followed by Return. If you forget to type the semicolon before pressing Return, type the semicolon at the command prompt and press Return again.
UPDATE user SET password = PASSWORD('secret') WHERE user = 'root';
DELETE FROM user WHERE user = '';
Note: The quotes before the semicolon are two single quotes with no space in between.
FLUSH PRIVILEGES;
Note: Installing a standalone version of MySQL on Mac OS X 10.5 often results in an error message that PHP cannot connect to MySQL. There are several ways to solve this problem. One of the easiest is to create a symlink (alias) so that PHP finds the connection socket, mysql.sock, where it expects it to be. Open Terminal, and enter the following command followed by Return:
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
Enter your Mac password when prompted.
From now on, all your interaction with MySQL will be through Dreamweaver or phpMyAdmin, which you'll install next.
Since phpMyAdmin is PHP based, all that's needed to install it is to download the files, unzip them to a website in your local testing environment, and create a simple configuration file. phpMyAdmin 3 requires a minimum of PHP 5.2 and MySQL 5.0. If you are running earlier versions, you must install phpMyAdmin 2.
Create a new subfolder called config within the phpmyadmin folder.
Windows users skip to step 7. Mac users continue with step 6.
Scroll down to the Actions field, and click Add. You'll see two buttons labeled Add. Make sure you click the one that has a Cancel button alongside.
The next screen will probably warn you that you didn't set up a phpMyAdmin database, so you won't be able to use all the phpMyAdmin features. This is not important. You can set up one later if you decide to use the advanced features of phpMyAdmin.
Now that you have a PHP development environment, you're ready to define a PHP site in Dreamweaver, as described on the next page.