For running samples for Chapter 6, 7, and 8, the MySQL data dump has been provided in the file flights.sql
. This file is present in the begin_guice/
directory. In order to check out if the samples for these chapters are running, follow the given steps:
Start the MySQL server:
shell> mysqld start
Login as a root user into MySQL server:
shell> mysql –uroot –A
Create a database flights:
mysql>create database flights;
Grant the permission to a user flight with password as flight:
mysql>grant all on flights.* to 'flight'@'localhost' identified by 'flight';
Quit the MySQL console:
mysql> quit;
Import the data into the flights table from shell:
shell> mysql flights -uflight -pflight < flights.sql
Log back again with credentials for flight:
shell>mysql flights -uflight -pflight
Check the data:
mysql>select * from flight;
The execution of last command would show the data in the table flight
.
Prior to running the samples from Chapter 6 to Chapter 8, make sure the MySQL server is running.