Part 1 in a Full Stack Series
The following are tools that will be used in this demo..
- XAMPP for managing the MariaDB/MySQL database
- MySQL
- Eclipse IDE
- Spring Initializr
Once you have the necessary tools downloaded and installed you are ready to follow along. This is not meant to be a full step by step guide to installing necessary dependencies. If you need help with that, leave a comment and I will do my best to help.
The purpose of this demo will be to show you how to create a database, starting the database server, and connecting to that database from your application, which will allow you to manipulate and work with your database from your spring application.
The first thing we will do will be create our database. After you have XAMPP installed open it on your machine. This opens the XAMPP Control Panel. You should see a list of “modules” that will be available to start running as well as options to configure, open logs, and open the Shell terminal.
Since I am using MySQL I am going to click the action “Start” on the MySQL line. This starts the MySQL server and tells you which Port that server is running on. Mine is running on Port 3306. This has started a local server on your machine and is telling you that your localhost port 3306 is listening for the MySQL database. This will make sense once you connect the database with your application.
Next, open the XAMPP shell in order to do initial configuration and navigate to your MariaDB database. The first command to run is
mysql -u root;
This starts the MaraDB connection and is how you will manipulate the database(which we are about to create) from command line if you chose. To make sure you have all privileges for your database you can run