Newly Revised MySQL Tutorial
1:30 PM: corrections made.
Thanks to really helpful contributions from a number of students, including
Daniel Ranells, Joel Kemp, Damien Harrigan, Mayumi Togawa, and others (remind
me, and I'll add your names), the MySQL tutorial is now much simplified.
As before, I don't have a "clean machine" to test this on. Some things may
work only because of things I did earlier. I'll try to check that.
- You have mail with an attachment named
resetdb.sql
provided by Daniel Ranells. Put it in
C:\MySQL\bin .
(Or wherever else you installed MySQL.)
- Open a DOS window and navigate to
C:\MySQL\bin or wherever else you
have installed MySQL. Do mysqld . Wait;
it takes a few seconds. No harm is done if MySQL is already running.
- In the same DOS window enter mysql -u root <
resetdb.sql . If you have a root password (and there is no reason
why you should) add -p after
-u root . This sets the database to be what is provided in
the sixth edition of the text; what is in the fifth edition can cause
problems. On the course CD, unzip
JavaHTP6e_examples.zip to get the programs from Chapter 25.
The books.sql database on the CD is all wrong, for us; don't use it.
Daniel's resetdb.sql has five of our
books.
- The preceding step takes care of all the stuff in Step 8 of the earlier
tutorial.
- Log in with mysql -u jhtp6 -p and
enter the password (jhtp6).
- You are now in the MySQL monitor, as indicated by the
mysql> prompt.
- Enter use 221books; Daniel's
resetdb.sql
set up that database.
- And there you are. Try
select firstName, lastName, title from titles;
- The synopses are long. If you do select
* from titles; you will get everything, but it will be hard
to read. For the prototype, forget about the synopses. My thinking is that
we'll figure out how to present that, as a user option. Details tba.
Back to Dan McCracken's Home Page