I have already installed a git on my system so I can use git to clone this GitHub repository alright so just type the command git clone and just copy this URL and paste it here and just hit enter alright we have successfully cloned this GitHub repository from GitHub all right so if you can check out the application.properties file just right click and edit with notepad plus and look at here we have configured MySQL, uh you know local server URL here localhost and then followed by 3306 and name of the database and this username and password and this is my second dialect, okay and this is a property to create tables automatically and update the tables automatically.
Let’s go back to the AWS console and let’s see the status it is backing up okay let’s wait a couple of more minutes to change this status to available and there we go the status is available and successfully created database java guides okay great now look at here this is the DB identifier so go ahead and click on this all right and if you look at the connectivity and security section here this is the endpoint URL and this is the port database board and this is a security section and this is networking now what we’re going to do is we’re going to change the security up for this database okay so go ahead and click on this default link here.
Basically, we need to provide security to access this database from anywhere so for that let’s go ahead and let’s change the security here okay just go ahead and click on this security group ID here all right now just click on edit inbound rules now let’s go and let’s add a rule here just choose MySQL aurora and then the source we need to change here just change from custom to anywhere so we need to access this database from anywhere so let’s choose anywhere here and that’s it and click on save rules.
Inbound security group rule is successfully applied now let’s go back to our database instance all right we have successfully you know configured MySQL database on Amazon, uh you know AWS cloud using RDS service, so next step is we need to connect MySQL database with MySQL workbench to verify the connectivity let’s head over to the MySQL workbench and let’s make a connection from MySQL workbench to this MySQL database that we have just configured in AWS cloud using AWS RDS service.
Go to the MySQL workbench like this and so look at here my SQL connection, so this is a plus icon go ahead and click on this plus icon here and this will bring you you know pop-up screen and here we need to just enter the details’ connection name provide java guides uh okay java guides on AWS something like this and here hostname so let’s give a hostname as endpoint URL so let me show you how to get the hostname from the AWS cloud so look at here this is the java guides DB instance right and if you go to the connectivity and security section here we have endpoint and port so you need to copy this endpoint.
This is the endpoint or host for this database just copy and paste in the hostname section and we have provided username for you know database as a root and password as a password and just click on test connection here we go successfully made the MySQL connection that’s awesome right we have successfully made a connection from MySQL workbench to MySQL database on AWS cloud all right click on ok and click on ok here also and here we go so go ahead and click on this connection here all right we have successfully made a connection from my secure workbench to MySQL database on AWS cloud let’s take a look into the next step, so next step is we need to clone spring boot application source code from GitHub.
We have already completed this step, so the next step is we need to update the application.properties file to just change the JDBC MySQL URL property all right we have configured MySQL database on AWS cloud using AWS IDs right now I’m gonna simply replace a localhost MySQL database URL with a MySQL database which is configured on AWS cloud so just go ahead and copy this endpoint or hostname and go to the application.properties file of our springboard application so look at here this is the JDBC URL right JDBC MySQL URL and earlier it was pointing to localhost MySQL database now let’s go and let’s replace from localhost to this hostname.
This is the MySQL database URL which was hosted on AWS cloud all right that’s it now let’s go and let’s create the user’s DB database inside MySQL database so let’s go ahead and let’s head over to the MySQL workbench and here just write the query create database followed by a name of the database and execute the query here and just go ahead and you know to refresh the schemata and there we go we have successfully created users okay and this database is created on you know Amazon cloud because we have successfully made a connection to MySQL DB instance on Amazon cloud right now we have created users DB database.
Let’s take a look into the next step alright so next step is we need to package our spring boot application as a jar file and then we deploy this springboot.jar file on AWS using elastic bin stack service so go back to the application properties file again and what we’re going to do is we’re going to change the spring boot application server port so by default springboard application listen to a port edge right zero right that is embedded tomcat server port but elastic bin stock service expect spring boot application to listen a port 5000.
Let’s just change the port number here server dot port, so this is the property to change the default port so let’s go ahead and let’s do port number as 5000. Okay now go to the file system and we need to package our spring boot application as a jar file so let’s click here and just type cmd, so this will bring a cmd inside this folder and just go ahead and just type Marvin so make sure that you have installed Marvin on your machine just type maven clean install and hit enter, so this will make a maven build for this springboard application let’s wait a couple of seconds so lot oat here the build is failed because we have provided a wrong database password so let’s go back to the application.properties file and look at here we haven’t changed the password here.
We have provided username as a root and password as a password right, so this is important guys so whenever you configure MySQL database on Amazon cloud you need to replace the host here and then username and password okay now let’s go back to the command prompt and here let’s again enter the command Marvin clean installation.