25.7. Creating Database books in MySQL

For each MySQL database we discuss in this book, we provide a SQL script in a file with the .sql extension that sets up the database and its tables. You can execute these scripts in the MySQL monitor. In the examples directory for this chapter, you’ll find the SQL script books.sql to create the books database. For the following steps, we assume that the MySQL server (mysqld-nt.exe) is still running. To execute the books.sql script:

1.
Open a Command Prompt and use the cd command to change directories to the location that contains the books.sql script.
2.
Start the MySQL monitor by typing
mysql -h localhost -u jhtp7 -p
The -p option prompts you for the password for the jhtp7 user account. When prompted, ...

Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.