Connect with MySQL DB through MuleSoft
We can connect with MySQL DB through MuleSoft by adding the dependent jar and providing the connection details
Create a project in Anypoint Studio
Drag and Drop database activity in a flow
Click on the Connector Configuration Add button and select the MySQL option from the connection drop down
Now Click on Required Libraries Configure and select Add Maven dependency
Copy the dependency from – select the version as per your installed MySQL
https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.22
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.22</version> </dependency>
Click Finish
The dependency will be installed in the project
Provide the details
Click Test Connection
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.
Thanks for the hoot? I am still stuck. I am seeing an access denied in the log on the mulesoft. The most recent attempt is with the I guess encrypted password install of mysql. The instal kind of forces it. So, I am trying to get the mysql example working from the mulesott examples. The video about configuring database is missing. Anyways, when I run the example code that effectively does a query by last name returning first name it fails getting connection. I did a grant all on the company database for the user. Kind of funny that the… Read more »
Try with the latest on i.e. 8.0.33 – https://mvnrepository.com/artifact/mysql/mysql-connector-java