Database Configuration

HOW TO INSTALL MYSQL AND CONFIGURING TO ANYPOINT STUDIO:

⇒ Go to the link provided and download Mysql.

https://dev.mysql.com/downloads/windows/installer/8.0.html

⇒ Click on Download.

⇒ Mysql installer get downloaded into your device.

⇒ Click on open

⇒ Select custom ⇒ Next

⇒ You can find Available products.

⇒ Now we have to add the Mysql server.

⇒ Click on MYSQL Servers ⇒ Mysql server ⇒ Mysql server 8.0 (latest version).

⇒ On clicking on green arrow, we can add workbench.

⇒ Similarly we have to repeat same for the applications.

⇒ Add Mysql Workbench

⇒ Add Mysql Shell.

⇒ Click on Next

⇒ Click ⇒ Next

⇒ Click ⇒ Next

⇒ Click ⇒ Next

⇒ Click⇒ Execute

Server, workbench and Shell gets installed in your device.

After successful installation ⇒

⇒ Click⇒ Next

⇒ Click ⇒ Next and give “Root password”.

If you are already an existed user, use your old root password.

⇒ Click⇒ Next⇒ Next⇒ Execute

⇒ Execute

⇒ Finish⇒ Now, you can pop up a window like,

Click on Local instance⇒ type password⇒

Go to the folder location (MYSQL)

 Open

⇒ C

⇒ Program files

⇒ MYSQL

⇒ Mysql server 8.0

⇒ Bin

Copy the path of the Bin

Example: C:\Program Files\MySQL\MySQL Server 8.0\bin

——————————————————————————————–

Now open cmd (command prompt).

Paste path in CMD with cd (current directory),

Use command to access MYSQL

Command:   mysql -u root –p

Enter password: ******

We can able to see MYSQL successfully installed in our device.

We can make the use of database now.

Now, Install MySQL Yog.

https://sqlyog.en.softonic.com/

Go through the above link to download MySQL Yog.

⇒ Create a new connection:

Use the password same as given in your installation of MySQL.

Make sure the database name should be the name of your database.

Then ⇒ Connect.

 

Go to Any Point Studio

⇒ Drag and drop database connector

⇒ Add connector configuration

⇒ Connector configuration (Give database MySQL config.)

⇒ Download manually or add dependency:

<dependency>

<groupId>mysql</groupId>

<artifactId>mysql-connector-java</artifactId>

<version>5.1.48</version>

<type>jar</type>

</dependency>

Give the details and then connect,

Check test connection if needed:

Now, you are successfully connected to your local server(database) through Any Point Studio.

—————————————

EXAMPLE:

//Optional

Some basic commands of SQL in CMD

Mysql> create database college;(college=database name)

Mysql> use college; (uses database college)

Mysql> create table student(name VARCHAR(20), id INT, address VARCHAR(100));

(Creates table with name=student with columns name, id, address)

Mysql> Insert into student values(“ramesh”,212,”hyderabad);

(Inserts student details)

Add multiple fields and retrieve using SELECT

Mysql> SELECT * from student;

  1. Created a table in MYSQL, connected to Any point studio and retrieve the table values using Mysql commands in any point studio.

I want to retrieve the table name “student” by giving credentials.

Using command in SQL query text ⇒

SELECT * from student;

⇒ RUN ⇒ DEPLOYED

After making a Hit from postman ⇒

Retrieve successful.

Thankyou.