Now that you've installed MySQL and created a forum database, you must install the database. You do this using a script file provided at the Sams Web site. This script file, which is explained in greater detail in Chapter 7, contains all of the SQL necessary to create your forum database. The script is designed to be called against either a blank database or a database that already has a forum. If you run this script against an existing forum database, it will reset the database back to its original state. To run this script, you must be at a command prompt. Make sure you are in a directory that contains createforum.sql. From the command prompt, issue this command: mysql u forumuser <createforum.sql Once this command executes, you will have the tables necessary to test the forum application. To ensure that you installed everything correctly, you should perform a query against the t_users table. To do this, enter MySQL with the following command: mysql u forumuser Now that you are inside MySQL, you must set the correct database: use forum; At this point, you can perform a basic SQL SELECT statement, such as the following: select * from t_users; If all of these commands execute properly, your screen should look like the one shown in Figure C.5. You now have MySQL properly installed and the forum database ready for use. One configuration issue remains: You must install a driver so that Java can get to MySQL. |