The sample files for Dreamweaver include a SQL script capable of creating and populating a sample MySQL database.
Before starting, make sure MySQL is installed and configured on your local or remote computer. Download the latest version from the MySQL website at http://dev.mysql.com/downloads/. For development purposes, download and install the Windows Essentials version of the MySQL database server.
If you installed Dreamweaver to its default location, the path to the script file is as follows:
If the computer running MySQL is a Windows computer, copy the insert.sql script to Program Files\MySQL\MySQL Server 4.x\bin. If the computer running MySQL is a Macintosh, copy the insert.sql script to your Documents folder in your home folder.
The MySQL clients command prompt appears, as follows:
mysql>
mysql -uUser
-pPassword
For example, if your MySQL user name (also known as an account name) and password are Tara and Telly3, enter the following command:
mysql -uTara -pTelly3
If you dont have a password, omit the -p
argument as follows:
mysql -uTara
If you didnt define a user name while configuring your MySQL installation, enter root as the user name, as follows:
mysql -uroot
The MySQL clients command prompt appears, as follows:
mysql>
mysql>CREATE DATABASE CafeTownsend;
MySQL creates a new database, but it doesnt contain any tables or records yet.
mysql>quit;
In Windows, use the following command:
cd \ cd Program Files\MySQL\MySQL Server 4.x\bin mysql -uUser
-pPassword
CafeTownsend < insert.sql
On the Macintosh, use the following command:
mysql -uUser
-pPassword
CafeTownsend < ~/Documents/insert.sql
This command uses the insert.sql file to add tables and records to the CafeTownsend database you created in step 5.
After creating the MySQL database, create a database connection to it in Dreamweaver. (See Creating a database connection.)