318 Setup for Sample PHP Site
8.
At the system command prompt, populate the new CafeTownsend
database in MySQL.
In Windows, use the following command:
cd \
cd Program Files\MySQL\MySQL Server 4.x\bin
mysql -u
User
-p
Password
CafeTownsend < insert.sql
On the Macintosh, use the following command:
mysql -u
User
-p
Password
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.
Creating a database connection
The final step of the setup process is to create a connection to the database.
To create a database connection in Dreamweaver:
1.
Open any PHP page in Dreamweaver and then open the Databases
panel (Window > Databases).
2.
Click the Plus (+) button on the panel and select MySQL Connection
from the pop-up menu.
The MySQL Connection dialog box appears,
3.
Enter
connTownsend
as the connection name.
4.
In the MySQL Server text box, specify the computer hosting MySQL.
Enter an IP address or a server name. If MySQL is running on the same
computer as Dreamweaver, enter
localhost
.
5.
Enter your MySQL user name and password.
If you didn’t define a user name while configuring your MySQL
installation, enter
root
in the Username text box. If you don’t have a
password, leave the Password text box blank.
6.
In the Database text box, enter
CafeTownsend
.
CafeTownsend is the name of the sample MySQL database you created
(see
“Creating the MySQL database” on page 316
).
Summary of Contents for DREAMWEAVER 8-GETTING STARTED WITH...
Page 1: ...Getting Started with Dreamweaver...
Page 8: ...8 Contents...
Page 10: ......
Page 46: ...46 Dreamweaver Basics...
Page 48: ......
Page 128: ...128 Tutorial Formatting Your Page with CSS...
Page 136: ...136 Tutorial Publishing Your Site...
Page 138: ......
Page 189: ...Add a Repeat Region XSLT object 189 3 Select Insert XSLT Objects Repeat Region...
Page 196: ...196 Tutorial Displaying XML Data...
Page 216: ......
Page 230: ...230 Understanding Web Applications...
Page 236: ...236 Installing a Web Server...
Page 254: ...254 Setup for Sample ColdFusion Site...
Page 268: ...268 Setup for Sample ASP NET Site...
Page 284: ...284 Setup for Sample ASP Site...
Page 300: ...300 Setup for Sample JSP Site...
Page 320: ...320 Setup for Sample PHP Site...