To connect an external database, you have to follow the below steps:
Start by adding the dependency for MySQL Connector to pom.xml
Then remove H2 Dependency from pom.xml
Now, set up your MySQL database and configure your connection to the MySQL database
Restart your project