Categories
MySQL Spring

Spring Boot MySQL integration tests with Testcontainers

When it comes to writing database integration tests with Spring Boot, there are two options: an in-memory database or Testcontaienrs. As we already covered Testing Spring Data Repositories with H2 in-memory database, we shift the gear in this article and focus on writing Spring Boot MySQL integration tests with Testcontainers. Introduction Although utilizing an in-memory […]

Categories
MySQL

How to enable MySQL query logging

To inspect MySQL query execution, one can enable query logging and pipe the output to a file or table to gain insights about running queries. In this article, we cover how to enable MySQL querying logging and save queries to a file. When using an ORM framework, developers often want to know what’s happening behind […]

Categories
MySQL

Export MySQL query results as JSON

In one of the latest post, I discussed how to transform a large MySQL table to JSON using Apache Spark. Well, that approach works for any tables with any volume. But it’s an overkill for simple and small tables. The good news is MySQL by default has a feature for that. In this article, I […]

Categories
MySQL

Emulating intersection in MySQL with self-join

As you may know, MySQL does not support INTERSECT operation. Hence, to get the intersection between two result sets in the same table, we need to use self-join. In this tutorial, I cover the emulating intersection in MySQL with self-join. But what the heck is self-join? Essentially, self-join is a simple join where both sides […]

Categories
MySQL Spring

MySQL batch insertion with Spring Data JPA

Batch insertion is essential when it comes to large data sets batch operations. It significantly reduces the database round trips and boosts the operation performance. Hence, it facilitates scaling the application with good performance. In this post, we will discuss how to do MySQL batch insertion with Spring Data JPA. Introduction Spring Data JPA uses […]

Categories
Linux MySQL

Enable MySQL query logging in Ubuntu

In this post, I explain about how to enable MySQL query logging for all queries. To enable query logging, historically you needed to edit my.cnf file under /etc/mysql path. However, the path and the file name is not valid anymore. In the newer versions, you need to edit mysqld.cnf that is located at /etc/mysql/mysql.conf.d. To […]

Exit mobile version