appendix-e

Appendix E. Installing MySQL and creating a database

 

In some of the examples we implement in chapters 12 through 14, we use an external database management system (DBMS). For these examples, you’ll need to create a database for your app to use prior to implementing the project.

For the database technology, you have plenty of options to choose from, like MySQL, Postgres, Oracle, MS SQL server, and so on. I encourage you to select the technology you like if you already have a preferred one. For examples in the book, I had to choose a certain database technology, and I decided to use MySQL, which is free, lightweight, and easy to install on any operating system. You’ll find MySQL used in general for tutorials and examples.

For learning Java and Spring, it’s irrelevant which DBMS technology you use. The Java and Spring classes and methods are the same, whether you choose MySQL, Oracle, Postgres, or any other relational database technology.

The steps for creating a database for use in the examples are the following:

  1. Install the DBMS on your local system; we will use MySQL.
  2. Install a client application for the DBMS; we will use MySQL Workbench, which is one of the most well-known client apps for MySQL.
  3. In the client app, connect to the local DBMS installation.
  4. Create the database you want to use in the example.

E.1 Step 1: Install a DBMS on your local system

E.2 Step 2: Install a client application for your DBMS

E.3 Step 3: Connecting to the local DBMS

E.4 Step 4: Add a new database